add BaseUrl test cases
This commit is contained in:
parent
fb864659d8
commit
164503f408
1 changed files with 28 additions and 0 deletions
28
tests/test_url.py
Normal file
28
tests/test_url.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from src.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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue