From fabfb7484e344fa22870ea942be652c5f5929e3a Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Thu, 12 Sep 2024 15:50:26 +0200 Subject: [PATCH] improve test coverage for scim errors --- tests/test_core.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 7dbc66cdc..d54563d4e 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -423,6 +423,11 @@ def test_deletes(config, requests_mock): }, errors.TemporarilyUnavailable('errorMessage', error_code='TEMPORARILY_UNAVAILABLE', retry_after_secs=100)), + (404, {}, { + 'scimType': 'scim type', + 'detail': 'detail', + 'status': 'status', + }, errors.NotFound('scim type detail', error_code='SCIM_status')), ]) def test_error(config, requests_mock, status_code, headers, body, expected_error): client = ApiClient(config) @@ -443,12 +448,6 @@ def test_error(config, requests_mock, status_code, headers, body, expected_error assert expected.metadata == actual.metadata -def test_error_with_scimType(): - args = {"detail": "detail", "scimType": "scim type"} - error = DatabricksError(**args) - assert str(error) == f"scim type detail" - - @contextlib.contextmanager def http_fixture_server(handler: typing.Callable[[BaseHTTPRequestHandler], None]): from http.server import HTTPServer