MCPcopy Create free account
hub / github.com/encode/starlette / test_router_query_method

Function test_router_query_method

tests/test_routing.py:312–320  ·  view source on GitHub ↗
(client: TestClient)

Source from the content-addressed store, hash-verified

310
311
312def test_router_query_method(client: TestClient) -> None:
313 response = client.request("QUERY", "/search")
314 assert response.status_code == 200
315 assert response.text == "Hello, QUERY!"
316
317 response = client.get("/search")
318 assert response.status_code == 405
319 assert response.text == "Method Not Allowed"
320 assert response.headers["allow"] == "QUERY"
321
322
323def test_router_add_websocket_route(client: TestClient) -> None:

Callers

nothing calls this directly

Calls 2

requestMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected