Skip to content

Commit

Permalink
Issue #3: preserve UDM errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fbotner committed Oct 14, 2022
1 parent 30e7e34 commit 32b6168
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/test_base_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,14 +721,13 @@ async def test_modify_error_exception(user_created_via_http, udm_kwargs, error):
obj.props[attribute] = value
try:
await obj.save()
assert False # pragma: no cover
except ModifyError as e:
assert str(e) == msg
assert e.reason == "Unprocessable Entity"
assert isinstance(e.dn, str)
assert isinstance(e.error, dict)
assert isinstance(e.status, int)
else:
raise Exception("did not raise ModifyError")


@pytest.mark.asyncio
Expand Down Expand Up @@ -760,14 +759,13 @@ async def test_create_error_exception(udm_kwargs, error, faker):
obj.props[attribute] = value
try:
await obj.save()
assert False # pragma: no cover
except CreateError as e:
assert str(e) == msg
assert e.reason == "Unprocessable Entity"
assert e.dn is None
assert isinstance(e.error, dict)
assert isinstance(e.status, int)
else:
raise Exception("did not raise CreateError")


@pytest.mark.asyncio
Expand Down

0 comments on commit 32b6168

Please sign in to comment.