File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from fastapi import FastAPI
55from app .api import users
66
7- log_format = ' %(asctime)s | %(levelname)-8s | %(name)-12s - %(message)s'
7+ log_format = " %(asctime)s | %(levelname)-8s | %(name)-12s - %(message)s"
88logging .basicConfig (stream = sys .stdout , level = logging .DEBUG , format = log_format )
99
1010app = FastAPI (title = "Python FastAPI Template" , version = "0.1.0" )
Original file line number Diff line number Diff line change 88async def test_create_user ():
99 transport = httpx .ASGITransport (app = app )
1010 async with httpx .AsyncClient (transport = transport , base_url = "http://test" ) as ac :
11- response = await ac .post ("/api/v1/users/" , json = {"name" : "Simone" , "email" : "simone@example.com" })
11+ response = await ac .post (
12+ "/api/v1/users/" , json = {"name" : "Simone" , "email" : "simone@example.com" }
13+ )
1214 assert response .status_code == 200
1315 data = response .json ()
1416 assert data ["name" ] == "Simone"
1517 assert data ["email" ] == "simone@example.com"
1618
19+
1720@pytest .mark .asyncio
1821async def test_get_users ():
1922 transport = httpx .ASGITransport (app = app )
You can’t perform that action at this time.
0 commit comments