librefi/tests/url_utils.py

16 lines
350 B
Python

from librefi.utils import absolute_url
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)
assert isinstance(abso, (str))
print(abso)
assert abso == NEW_URL_ABSOLUTE
pass