1111@pytest .mark .parametrize (
1212 ("server_url" ),
1313 [
14- ("https://unstructured-000mock.api.unstructuredapp.io" ), # correct url
14+ ("https://unstructured-000mock.api.unstructuredapp.io" ), # correct url
1515 ("unstructured-000mock.api.unstructuredapp.io" ),
1616 ("http://unstructured-000mock.api.unstructuredapp.io/general/v0/general" ),
1717 ("https://unstructured-000mock.api.unstructuredapp.io/general/v0/general" ),
1818 ("unstructured-000mock.api.unstructuredapp.io/general/v0/general" ),
19- ]
19+ ],
2020)
2121def test_clean_server_url_on_paid_api_url (server_url : str ):
2222 client = UnstructuredClient (
2323 server_url = server_url ,
2424 api_key_auth = FAKE_KEY ,
2525 )
26- assert client .general .sdk_configuration .server_url == "https://unstructured-000mock.api.unstructuredapp.io"
26+ assert (
27+ client .general .sdk_configuration .server_url
28+ == "https://unstructured-000mock.api.unstructuredapp.io"
29+ )
2730
2831
2932@pytest .mark .parametrize (
3033 ("server_url" ),
3134 [
32- ("http://localhost:8000" ), # correct url
35+ ("http://localhost:8000" ), # correct url
3336 ("localhost:8000" ),
3437 ("localhost:8000/general/v0/general" ),
3538 ("http://localhost:8000/general/v0/general" ),
36- ]
39+ ],
3740)
3841def test_clean_server_url_on_localhost (server_url : str ):
3942 client = UnstructuredClient (
@@ -56,15 +59,18 @@ def test_clean_server_url_on_empty_string():
5659 [
5760 ("https://unstructured-000mock.api.unstructuredapp.io" ),
5861 ("unstructured-000mock.api.unstructuredapp.io/general/v0/general" ),
59- ]
62+ ],
6063)
6164def test_clean_server_url_with_positional_arguments (server_url : str ):
6265 client = UnstructuredClient (
6366 FAKE_KEY ,
6467 "" ,
6568 server_url ,
6669 )
67- assert client .general .sdk_configuration .server_url == "https://unstructured-000mock.api.unstructuredapp.io"
70+ assert (
71+ client .general .sdk_configuration .server_url
72+ == "https://unstructured-000mock.api.unstructuredapp.io"
73+ )
6874
6975
7076def test_suggest_defining_url_if_401 ():
@@ -73,11 +79,11 @@ def test_suggest_defining_url_if_401():
7379 client = UnstructuredClient (
7480 api_key_auth = FAKE_KEY ,
7581 )
76-
82+
7783 filename = "_sample_docs/layout-parser-paper-fast.pdf"
78-
84+
7985 with open (filename , "rb" ) as f :
80- files = shared .Files (
86+ files = shared .Files (
8187 content = f .read (),
8288 file_name = filename ,
8389 )
0 commit comments