Skip to content

Commit e4bd253

Browse files
committed
Remove magic 422
1 parent 9d0ba7f commit e4bd253

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/test_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,9 @@ async def test_500_raises_server_error(
332332

333333
async def test_422_raises_api_error(mock_api, authenticated_client: EVEClient):
334334
"""Test that 422 response code raises APIError"""
335-
unprocessable_entity = 422
336335
mock_api.post("/conversations").mock(
337336
return_value=Response(
338-
unprocessable_entity,
337+
HTTPStatus.UNPROCESSABLE_ENTITY,
339338
json={
340339
"detail": [{"msg": "field required", "type": "missing"}],
341340
},
@@ -345,7 +344,7 @@ async def test_422_raises_api_error(mock_api, authenticated_client: EVEClient):
345344
with pytest.raises(APIError) as exc_info:
346345
await authenticated_client.post("/conversations", json={})
347346

348-
assert exc_info.value.status_code == unprocessable_entity
347+
assert exc_info.value.status_code == HTTPStatus.UNPROCESSABLE_ENTITY
349348

350349

351350
async def test_response_missing_detail_raises_api_error(

0 commit comments

Comments
 (0)