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

Function test_request_raw_path

tests/test_requests.py:206–216  ·  tests/test_requests.py::test_request_raw_path
(test_client_factory: TestClientFactory)

Source from the content-addressed store, hash-verified

204
205
206def test_request_raw_path(test_client_factory: TestClientFactory) -> None:
207 async def app(scope: Scope, receive: Receive, send: Send) -> None:
208 request = Request(scope, receive)
209 path = request.scope[class="st">"path"]
210 raw_path = request.scope[class="st">"raw_path"]
211 response = PlainTextResponse(fclass="st">"{path}, {raw_path}")
212 await response(scope, receive, send)
213
214 client = test_client_factory(app)
215 response = client.get(class="st">"/he%2Fllo")
216 assert response.text == class="st">"/he/llo, b&class="cm">#x27;/he%2Fllo'"
217
218
219def test_request_without_setting_receive(

Callers

nothing calls this directly

Calls 2

test_client_factoryFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected