File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
_test_unstructured_client/unit Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ def test_unit_clean_server_url_fixes_malformed_urls_with_positional_arguments(se
230
230
)
231
231
232
232
233
- def test_unit_issues_warning_on_a_401 (caplog , session_ : Mock , response_ : requests .Session ):
233
+ def test_after_error_hook_logs (caplog , session_ : Mock , response_ : requests .Session ):
234
234
def mock_post (request ):
235
235
return Response (401 , request = request )
236
236
@@ -245,15 +245,13 @@ def mock_post(request):
245
245
req = operations .PartitionRequest (
246
246
partition_parameters = shared .PartitionParameters (files = files )
247
247
)
248
-
249
248
with pytest .raises (SDKError , match = "API error occurred: Status 401" ):
250
- with caplog .at_level (logging .WARNING ):
251
- session .general .partition (request = req )
252
-
253
- assert any (
254
- "This API key is invalid against the paid API. If intending to use the free API, please initialize UnstructuredClient with `server='free-api'`."
255
- in message for message in caplog .messages
256
- )
249
+ session .general .partition (request = req )
250
+
251
+ assert any (
252
+ "Server responded with 401"
253
+ in message for message in caplog .messages
254
+ )
257
255
258
256
259
257
# -- fixtures --------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments