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
230230 )
231231
232232
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 ):
234234 def mock_post (request ):
235235 return Response (401 , request = request )
236236
@@ -245,15 +245,13 @@ def mock_post(request):
245245 req = operations .PartitionRequest (
246246 partition_parameters = shared .PartitionParameters (files = files )
247247 )
248-
249248 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+ )
257255
258256
259257# -- fixtures --------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments