Skip to content

Commit 914b219

Browse files
committed
Check response code
1 parent 54e3e67 commit 914b219

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_exceptions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ def test_bad_image(client: VWS) -> None:
9595
A ``BadImage`` exception is raised when a non-image is given.
9696
"""
9797
not_an_image = io.BytesIO(b'Not an image')
98-
with pytest.raises(BadImage):
98+
with pytest.raises(BadImage) as exc:
9999
client.add_target(name='x', width=1, image=not_an_image)
100100

101+
assert exc.value.response.status_code == codes.UNPROCESSABLE_ENTITY
102+
101103

102104
def test_target_name_exist(
103105
client: VWS,

0 commit comments

Comments
 (0)