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

Function test_request_query_params

tests/test_requests.py:32–41  ·  view source on GitHub ↗
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

30
31
32def test_request_query_params(test_client_factory: TestClientFactory) -> None:
33 async def app(scope: Scope, receive: Receive, send: Send) -> None:
34 request = Request(scope, receive)
35 params = dict(request.query_params)
36 response = JSONResponse({"params": params})
37 await response(scope, receive, send)
38
39 client = test_client_factory(app)
40 response = client.get("/?a=123&b=456")
41 assert response.json() == {"params": {"a": "123", "b": "456"}}
42
43
44@pytest.mark.skipif(

Callers

nothing calls this directly

Calls 3

test_client_factoryFunction · 0.85
jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected