Skip to content

Commit

Permalink
improve test coverage for scim errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Sep 12, 2024
1 parent 87bca78 commit fabfb74
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit fabfb74

Please sign in to comment.