@@ -299,10 +299,10 @@ async def test_500_raises_server_error(
299299
300300async def test_422_raises_api_error (mock_api , authenticated_client : EVEClient ):
301301 """Test that 422 response code raises APIError"""
302- random_error = 422
302+ unprocessable_entity = 422
303303 mock_api .post ("/conversations" ).mock (
304304 return_value = Response (
305- random_error ,
305+ unprocessable_entity ,
306306 json = {
307307 "detail" : [{"msg" : "field required" , "type" : "missing" }],
308308 },
@@ -312,25 +312,25 @@ async def test_422_raises_api_error(mock_api, authenticated_client: EVEClient):
312312 with pytest .raises (APIError ) as exc_info :
313313 await authenticated_client .post ("/conversations" , json = {})
314314
315- assert exc_info .value .status_code == random_error
315+ assert exc_info .value .status_code == unprocessable_entity
316316
317317
318- async def test_response_invalid_json_raises_api_error (
318+ async def test_response_missing_detail_raises_api_error (
319319 mock_api , authenticated_client : EVEClient
320320):
321- """Test that invalid JSON in the response raises APIError"""
322- random_error = 452
321+ """Test that error response without 'detail' key raises APIError"""
322+ unknown_error = 452
323323 mock_api .post ("/conversations" ).mock (
324324 return_value = Response (
325- random_error ,
325+ unknown_error ,
326326 json = "Some invalid JSON" ,
327327 )
328328 )
329329
330330 with pytest .raises (APIError ) as exc_info :
331331 await authenticated_client .post ("/conversations" , json = {})
332332
333- assert exc_info .value .status_code == random_error
333+ assert exc_info .value .status_code == unknown_error
334334
335335
336336# --- Streaming ---
0 commit comments