librefi/tests/url_utils.py

20 lines
460 B
Python
Raw Normal View History

2020-11-29 01:14:58 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2020-09-18 18:12:30 +02:00
from librefi.utils import absolute_url
2020-11-29 02:36:57 +01:00
from librefi.compat import compat_str
2020-09-18 18:12:30 +02:00
OLD_URL = "https://sakamoto.pl/ddd"
NEW_URL_RELATIVE = "/DDD?test=yes"
# expected value
NEW_URL_ABSOLUTE = "https://sakamoto.pl/DDD?test=yes"
def test_basic():
abso = absolute_url(NEW_URL_RELATIVE, OLD_URL)
2020-11-29 02:36:57 +01:00
assert isinstance(abso, (compat_str))
2020-09-18 18:12:30 +02:00
print(abso)
assert abso == NEW_URL_ABSOLUTE
pass