e2e_tests/tests/test_url.py
Daniel 8685688698 installable package (#9)
* turn repo into installable package (pip install -e .)

* add hatchling build packend

* call it pytest-abra

* add pytest entrypoint, so that it gets loaded automatically if installed (and pytest is run)

* make fixtures optional, so that pytest can still be used in other context

* add cli script -> you can now directly run "pytest-abra" in console

Reviewed-on: local-it-infrastructure/e2e_tests#9
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
2023-12-07 11:32:01 +01:00

28 lines
783 B
Python

from pytest_abra.utils import BaseUrl
url_input = {
"netloc": "blog.dev.local-it.cloud",
"scheme": "https",
}
url_obj = BaseUrl(**url_input)
def test_urllib_domain_only():
assert url_obj.get() == "https://blog.dev.local-it.cloud"
def test_urllib_path_single():
assert url_obj.get(path="something") == "https://blog.dev.local-it.cloud/something"
def test_urllib_path_double():
assert url_obj.get(path="something/else") == "https://blog.dev.local-it.cloud/something/else"
def test_urllib_path_signle_suc_slash():
assert url_obj.get(path="something/else/") == "https://blog.dev.local-it.cloud/something/else/"
def test_urllib_path_signle_pre_slash():
assert url_obj.get(path="/something/else") == "https://blog.dev.local-it.cloud/something/else"