@@ -198,23 +198,20 @@ def test_unit_clean_server_url_fixes_malformed_paid_api_url(server_url: str):
198
198
199
199
200
200
@pytest .mark .parametrize (
201
- "server_url" ,
201
+ "server_url,expected_url " ,
202
202
[
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" ),
209
207
],
210
208
)
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 ):
212
210
client = UnstructuredClient (
213
211
server_url = server_url ,
214
212
api_key_auth = FAKE_KEY ,
215
213
)
216
- assert client .general .sdk_configuration .server_url == "http://localhost:8000"
217
-
214
+ assert client .general .sdk_configuration .server_url == expected_url
218
215
219
216
@pytest .mark .parametrize (
220
217
"server_url" ,
0 commit comments