|
|
|
|
@ -58,6 +58,19 @@ class TestClientUsecases:
|
|
|
|
|
assert (version.major, version.minor) >= (2, 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_can_strip_trailing_slash_in_hostname_in_make_client(admin_user: str):
|
|
|
|
|
host, port = BASE_URL.split("://", maxsplit=1)[1].rsplit(":", maxsplit=1)
|
|
|
|
|
|
|
|
|
|
with make_client(host=host + "/", port=port, credentials=(admin_user, USER_PASS)) as client:
|
|
|
|
|
assert client.api_map.host == BASE_URL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_can_strip_trailing_slash_in_hostname_in_client_ctor(admin_user: str):
|
|
|
|
|
with Client(url=BASE_URL + "/") as client:
|
|
|
|
|
client.login((admin_user, USER_PASS))
|
|
|
|
|
assert client.api_map.host == BASE_URL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_can_detect_server_schema_if_not_provided():
|
|
|
|
|
host, port = BASE_URL.split("://", maxsplit=1)[1].rsplit(":", maxsplit=1)
|
|
|
|
|
client = make_client(host=host, port=int(port))
|
|
|
|
|
|