File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ async def test_add_stuff(client: AsyncClient):
2525 "description" : stuff ["description" ],
2626 }
2727 )
28+ response = await client .post ("/stuff" , json = stuff )
29+ assert response .status_code == status .HTTP_500_INTERNAL_SERVER_ERROR
30+ assert response .json () == snapshot ({'message' :'A database error occurred. Please try again later.' })
2831
2932
3033async def test_get_stuff (client : AsyncClient ):
34+ response = await client .get (f"/stuff/nonexistent" )
35+ assert response .status_code == status .HTTP_404_NOT_FOUND
36+ assert response .json () == snapshot ({'no_response' :'The requested resource was not found' })
3137 stuff = StuffFactory .build (factory_use_constructors = True ).model_dump (mode = "json" )
3238 await client .post ("/stuff" , json = stuff )
3339 name = stuff ["name" ]
You can’t perform that action at this time.
0 commit comments