()
| 101 | |
| 102 | |
| 103 | def test_nested_router(): |
| 104 | app = FastAPI() |
| 105 | |
| 106 | router = APIRouter(prefix="/nested") |
| 107 | |
| 108 | @router.get("/test") |
| 109 | async def test(var: Annotated[str, Query()] = "bar"): |
| 110 | return {"foo": var} |
| 111 | |
| 112 | app.include_router(router) |
| 113 | |
| 114 | client = TestClient(app) |
| 115 | |
| 116 | response = client.get("/nested/test") |
| 117 | assert response.status_code == 200 |
| 118 | assert response.json() == {"foo": "bar"} |
| 119 | |
| 120 | |
| 121 | def test_openapi_schema(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…