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

Function test_request_query_params

tests/test_requests.py:32–41  ·  tests/test_requests.py::test_request_query_params
(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({class="st">"params": params})
37 await response(scope, receive, send)
38
39 client = test_client_factory(app)
40 response = client.get(class="st">"/?a=123&b=456")
41 assert response.json() == {class="st">"params": {class="st">"a": class="st">"123", class="st">"b": class="st">"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