(test_client_factory: TestClientFactory)
| 354 | |
| 355 | |
| 356 | def test_app_add_route(test_client_factory: TestClientFactory) -> None: |
| 357 | async def homepage(request: Request) -> PlainTextResponse: |
| 358 | return PlainTextResponse("Hello, World!") |
| 359 | |
| 360 | app = Starlette( |
| 361 | routes=[ |
| 362 | Route("/", endpoint=homepage), |
| 363 | ] |
| 364 | ) |
| 365 | |
| 366 | client = test_client_factory(app) |
| 367 | response = client.get("/") |
| 368 | assert response.status_code == 200 |
| 369 | assert response.text == "Hello, World!" |
| 370 | |
| 371 | |
| 372 | def test_app_add_websocket_route(test_client_factory: TestClientFactory) -> None: |
nothing calls this directly
no test coverage detected