Skip to content

Commit e151b48

Browse files
committed
tests
1 parent 68413fe commit e151b48

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

_test_unstructured_client/unit/test_custom_hooks.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,23 +198,20 @@ def test_unit_clean_server_url_fixes_malformed_paid_api_url(server_url: str):
198198

199199

200200
@pytest.mark.parametrize(
201-
"server_url",
201+
"server_url,expected_url",
202202
[
203-
# -- well-formed url --
204-
"http://localhost:8000",
205-
# -- common malformed urls --
206-
"localhost:8000",
207-
"localhost:8000/general/v0/general",
208-
"http://localhost:8000/general/v0/general",
203+
("http://localhost:8000", "http://localhost:8000"),
204+
("localhost:8000", "http://localhost:8000"),
205+
("localhost:8000/general/v0/general", "http://localhost:8000/general/v0/general"),
206+
("http://localhost:8000/general/v0/general", "http://localhost:8000/general/v0/general"),
209207
],
210208
)
211-
def test_unit_clean_server_url_fixes_malformed_localhost_url(server_url: str):
209+
def test_unit_clean_server_url_fixes_non_unst_domain_url(server_url: str, expected_url: str):
212210
client = UnstructuredClient(
213211
server_url=server_url,
214212
api_key_auth=FAKE_KEY,
215213
)
216-
assert client.general.sdk_configuration.server_url == "http://localhost:8000"
217-
214+
assert client.general.sdk_configuration.server_url == expected_url
218215

219216
@pytest.mark.parametrize(
220217
"server_url",

0 commit comments

Comments
 (0)