aboutsummaryrefslogtreecommitdiff
path: root/app/tests/test_fastapi.py
blob: ad0303f56dd17622e0acdb66821f11ba2e19c0a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from starlette.testclient import TestClient

from api import app as fastapi_app

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}	

	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"