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

Function test_request_scope_interface

tests/test_requests.py:195–203  ·  view source on GitHub ↗

A Request can be instantiated with a scope, and presents a `Mapping` interface.

()

Source from the content-addressed store, hash-verified

193
194
195def test_request_scope_interface() -> None:
196 """
197 A Request can be instantiated with a scope, and presents a `Mapping`
198 interface.
199 """
200 request = Request({"type": "http", "method": "GET", "path": "/abc/"})
201 assert request["method"] == "GET"
202 assert dict(request) == {"type": "http", "method": "GET", "path": "/abc/"}
203 assert len(request) == 3
204
205
206def test_request_raw_path(test_client_factory: TestClientFactory) -> None:

Callers

nothing calls this directly

Calls 1

RequestClass · 0.90

Tested by

no test coverage detected