mirror of
https://github.com/fastapi/fastapi.git
synced 2026-09-14 13:36:21 +08:00
11d0a08acd
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
13 lines
306 B
Python
13 lines
306 B
Python
import pytest
|
|
from httpx import AsyncClient
|
|
|
|
from .main import app
|
|
|
|
|
|
@pytest.mark.anyio
|
|
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"}
|