Skip to content

Commit 2f12762

Browse files
committed
Clean up server url test cases
1 parent 27ccaa2 commit 2f12762

File tree

1 file changed

+15
-57
lines changed

1 file changed

+15
-57
lines changed

_test_unstructured_client/unit/test_server_urls.py

Lines changed: 15 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -67,61 +67,33 @@ class URLTestCase:
6767
"case",
6868
[
6969
URLTestCase(
70-
description="non UNST domain client-level URL, no path",
70+
description="custom client-level URL, no path",
7171
sdk_endpoint_name="general.partition_async",
7272
client_url="http://localhost:8000/",
7373
endpoint_url=None,
7474
expected_url="http://localhost:8000"
7575
),
7676
URLTestCase(
77-
description="non UNST domain client-level URL, with path",
77+
description="custom client-level URL, with path",
7878
sdk_endpoint_name="general.partition_async",
7979
client_url="http://localhost:8000/my/endpoint/",
8080
endpoint_url=None,
8181
expected_url="http://localhost:8000/my/endpoint"
8282
),
8383
URLTestCase(
84-
description="non UNST domain endpoint-level URL, no path",
84+
description="custom endpoint-level URL, no path",
8585
sdk_endpoint_name="general.partition_async",
8686
client_url=None,
8787
endpoint_url="http://localhost:8000/",
8888
expected_url="http://localhost:8000"
8989
),
9090
URLTestCase(
91-
description="non UNST domain endpoint-level URL, with path",
91+
description="custom endpoint-level URL, with path",
9292
sdk_endpoint_name="general.partition_async",
9393
client_url=None,
9494
endpoint_url="http://localhost:8000/my/endpoint/",
9595
expected_url="http://localhost:8000/my/endpoint"
9696
),
97-
URLTestCase(
98-
description="UNST domain client-level URL, no path",
99-
sdk_endpoint_name="general.partition_async",
100-
client_url="https://unstructured-000mock.api.unstructuredapp.io",
101-
endpoint_url=None,
102-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
103-
),
104-
URLTestCase(
105-
description="UNST domain client-level URL, with path",
106-
sdk_endpoint_name="general.partition_async",
107-
client_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/",
108-
endpoint_url=None,
109-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
110-
),
111-
URLTestCase(
112-
description="UNST domain endpoint-level URL, no path",
113-
sdk_endpoint_name="general.partition_async",
114-
client_url=None,
115-
endpoint_url="https://unstructured-000mock.api.unstructuredapp.io",
116-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
117-
),
118-
URLTestCase(
119-
description="UNST domain endpoint-level URL, with path",
120-
sdk_endpoint_name="general.partition_async",
121-
client_url=None,
122-
endpoint_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/",
123-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
124-
),
12597
URLTestCase(
12698
description="default URL fallback",
12799
sdk_endpoint_name="general.partition_async",
@@ -161,63 +133,49 @@ async def test_async_endpoint_uses_correct_url(monkeypatch, case: URLTestCase):
161133
"case",
162134
[
163135
URLTestCase(
164-
description="non UNST domain client-level URL, no path",
136+
description="custom client-level URL, no path",
165137
sdk_endpoint_name="destinations.create_destination",
166138
client_url="http://localhost:8000/",
167139
endpoint_url=None,
168140
expected_url="http://localhost:8000"
169141
),
170142
URLTestCase(
171-
description="non UNST domain client-level URL, with path",
143+
description="custom client-level URL, with path",
172144
sdk_endpoint_name="sources.create_source",
173145
client_url="http://localhost:8000/my/endpoint/",
174146
endpoint_url=None,
175147
expected_url="http://localhost:8000/my/endpoint"
176148
),
177149
URLTestCase(
178-
description="non UNST domain endpoint-level URL, no path",
150+
description="custom endpoint-level URL, no path",
179151
sdk_endpoint_name="jobs.get_job",
180152
client_url=None,
181153
endpoint_url="http://localhost:8000",
182154
expected_url="http://localhost:8000"
183155
),
184156
URLTestCase(
185-
description="non UNST domain endpoint-level URL, with path",
157+
description="custom endpoint-level URL, with path",
186158
sdk_endpoint_name="workflows.create_workflow",
187159
client_url=None,
188160
endpoint_url="http://localhost:8000/my/endpoint",
189161
expected_url="http://localhost:8000/my/endpoint"
190162
),
191163
URLTestCase(
192-
description="UNST domain client-level URL, no path",
164+
description="partition client level with path",
193165
sdk_endpoint_name="general.partition",
194-
client_url="https://unstructured-000mock.api.unstructuredapp.io",
166+
client_url="https://api.unstructuredapp.io/general/v0/general",
195167
endpoint_url=None,
196-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
197-
),
198-
URLTestCase(
199-
description="UNST domain client-level URL, with path",
200-
sdk_endpoint_name="general.partition",
201-
client_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/",
202-
endpoint_url=None,
203-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
204-
),
205-
URLTestCase(
206-
description="UNST domain endpoint-level URL, no path",
207-
sdk_endpoint_name="general.partition",
208-
client_url=None,
209-
endpoint_url="https://unstructured-000mock.api.unstructuredapp.io",
210-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
168+
expected_url="https://api.unstructuredapp.io"
211169
),
212170
URLTestCase(
213-
description="UNST domain endpoint-level URL, with path",
171+
description="partition endpoint level with path",
214172
sdk_endpoint_name="general.partition",
215173
client_url=None,
216-
endpoint_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/",
217-
expected_url="https://unstructured-000mock.api.unstructuredapp.io"
174+
endpoint_url="https://api.unstructuredapp.io/general/v0/general",
175+
expected_url="https://api.unstructuredapp.io"
218176
),
219177
URLTestCase(
220-
description="default URL fallback",
178+
description="partition default url",
221179
sdk_endpoint_name="general.partition",
222180
client_url=None,
223181
endpoint_url=None,

0 commit comments

Comments
 (0)