mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 18:46:40 +00:00
12 lines
308 B
Python
12 lines
308 B
Python
import pytest
|
|
from httpx import AsyncClient
|
|
|
|
from .main import app
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_root():
|
|
async with AsyncClient(app=app, base_url="http://test") as ac:
|
|
response = await ac.get("/")
|
|
assert response.status_code == 200
|
|
assert response.json() == {"message": "Tomato"}
|