MCPcopy
hub / github.com/encode/starlette / test_middleware

Function test_middleware

tests/test_applications.py:281–285  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

279
280
281def test_middleware(test_client_factory: TestClientFactory) -> None:
282 client = test_client_factory(app, base_url="http://incorrecthost")
283 response = client.get("/func")
284 assert response.status_code == 400
285 assert response.text == "Invalid host header"
286
287
288def test_routes() -> None:

Callers

nothing calls this directly

Calls 2

test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected