From ff23de920e1c0837bbc1a82799feeaef9c83a723 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 6 Jun 2021 15:22:02 +0530 Subject: testing if user does not exist --- app/tests/test_fastapi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/tests/test_fastapi.py b/app/tests/test_fastapi.py index c6b40cc..ad0303f 100644 --- a/app/tests/test_fastapi.py +++ b/app/tests/test_fastapi.py @@ -7,4 +7,9 @@ fastapi_client = TestClient(fastapi_app) def test_fastapi(app, client): res = fastapi_client.get("/version") assert res.status_code == 200 - assert res.json() == {"message":fastapi_app.version} \ No newline at end of file + assert res.json() == {"message":fastapi_app.version} + + res = fastapi_client.get("/v1/user-details?email={}".format("notadmin@example.com")) + print(res.json()) + assert res.status_code == 404 + assert res.json()["detail"] == "User Not Found" \ No newline at end of file -- cgit v1.2.3