@@ -53,7 +53,7 @@ def test_integration_split_pdf_has_same_output_as_non_split(
5353 except requests .exceptions .ConnectionError :
5454 assert False , "The unstructured-api is not running on localhost:8000"
5555
56- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
56+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
5757
5858 with open (filename , "rb" ) as f :
5959 files = shared .Files (
@@ -78,7 +78,10 @@ def test_integration_split_pdf_has_same_output_as_non_split(
7878 )
7979
8080 try :
81- resp_split = client .general .partition (request = req )
81+ resp_split = client .general .partition (
82+ server_url = "localhost:8000" ,
83+ request = req
84+ )
8285 except (HTTPValidationError , AttributeError ) as exc :
8386 if not expected_ok :
8487 assert "File does not appear to be a valid PDF" in str (exc )
@@ -130,7 +133,7 @@ def test_integration_split_pdf_with_caching(
130133 except requests .exceptions .ConnectionError :
131134 assert False , "The unstructured-api is not running on localhost:8000"
132135
133- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
136+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
134137
135138 with open (filename , "rb" ) as f :
136139 files = shared .Files (
@@ -155,7 +158,10 @@ def test_integration_split_pdf_with_caching(
155158 )
156159
157160 try :
158- resp_split = client .general .partition (request = req )
161+ resp_split = client .general .partition (
162+ server_url = "localhost:8000" ,
163+ request = req
164+ )
159165 except (HTTPValidationError , AttributeError ) as exc :
160166 if not expected_ok :
161167 assert "File does not appear to be a valid PDF" in str (exc )
@@ -169,7 +175,10 @@ def test_integration_split_pdf_with_caching(
169175 partition_parameters = parameters
170176 )
171177
172- resp_single = client .general .partition (request = req )
178+ resp_single = client .general .partition (
179+ server_url = "localhost:8000" ,
180+ request = req
181+ )
173182
174183 assert len (resp_split .elements ) == len (resp_single .elements )
175184 assert resp_split .content_type == resp_single .content_type
@@ -200,7 +209,7 @@ def test_long_pages_hi_res(filename):
200209 split_pdf_concurrency_level = 15
201210 ), )
202211
203- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
212+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
204213
205214 response = client .general .partition (request = req )
206215 assert response .status_code == 200
@@ -216,7 +225,7 @@ def test_integration_split_pdf_for_file_with_no_name():
216225 except requests .exceptions .ConnectionError :
217226 assert False , "The unstructured-api is not running on localhost:8000"
218227
219- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
228+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
220229
221230 with open ("_sample_docs/layout-parser-paper-fast.pdf" , "rb" ) as f :
222231 files = shared .Files (
@@ -233,7 +242,7 @@ def test_integration_split_pdf_for_file_with_no_name():
233242 )
234243 )
235244
236- pytest .raises (ValueError , client .general .partition , request = req )
245+ pytest .raises (ValueError , client .general .partition , request = req , server_url = "localhost:8000" )
237246
238247
239248@pytest .mark .parametrize ("starting_page_number" , [1 , 100 ])
@@ -272,7 +281,7 @@ def test_integration_split_pdf_with_page_range(
272281 except requests .exceptions .ConnectionError :
273282 assert False , "The unstructured-api is not running on localhost:8000"
274283
275- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
284+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
276285
277286 filename = "_sample_docs/layout-parser-paper.pdf"
278287 with open (filename , "rb" ) as f :
@@ -292,7 +301,10 @@ def test_integration_split_pdf_with_page_range(
292301 )
293302
294303 try :
295- resp = client .general .partition (request = req )
304+ resp = client .general .partition (
305+ server_url = "localhost:8000" ,
306+ request = req
307+ )
296308 except ValueError as exc :
297309 assert not expected_ok
298310 assert "is out of bounds." in caplog .text
@@ -333,7 +345,7 @@ def test_integration_split_pdf_strict_mode(
333345 except requests .exceptions .ConnectionError :
334346 assert False , "The unstructured-api is not running on localhost:8000"
335347
336- client = UnstructuredClient (api_key_auth = FAKE_KEY , server_url = "localhost:8000" )
348+ client = UnstructuredClient (api_key_auth = FAKE_KEY )
337349
338350 with open (filename , "rb" ) as f :
339351 files = shared .Files (
@@ -359,7 +371,10 @@ def test_integration_split_pdf_strict_mode(
359371 )
360372
361373 try :
362- resp_split = client .general .partition (request = req )
374+ resp_split = client .general .partition (
375+ server_url = "localhost:8000" ,
376+ request = req
377+ )
363378 except (HTTPValidationError , AttributeError ) as exc :
364379 if not expected_ok :
365380 assert "The file does not appear to be a valid PDF." in caplog .text
@@ -450,7 +465,6 @@ async def mock_send(_, request: httpx.Request, **kwargs):
450465
451466 sdk = UnstructuredClient (
452467 api_key_auth = FAKE_KEY ,
453- server_url = "localhost:8000" ,
454468 retry_config = RetryConfig ("backoff" , BackoffStrategy (200 , 1000 , 1.5 , 10000 ), False ),
455469 )
456470
@@ -470,7 +484,10 @@ async def mock_send(_, request: httpx.Request, **kwargs):
470484 )
471485 )
472486
473- res = await sdk .general .partition_async (request = req )
487+ res = await sdk .general .partition_async (
488+ server_url = "localhost:8000" ,
489+ request = req
490+ )
474491
475492 assert number_of_split_502s == 0
476493 assert number_of_last_page_502s == 0
0 commit comments