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

Function test_mutable_headers_from_scope

tests/test_datastructures.py:321–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

319
320
321def test_mutable_headers_from_scope() -> None:
322 # "headers" in scope must not necessarily be a list
323 h = MutableHeaders(scope={"headers": ((b"a", b"1"),)})
324 assert dict(h) == {"a": "1"}
325 h.update({"b": "2"})
326 assert dict(h) == {"a": "1", "b": "2"}
327 assert list(h.items()) == [("a", "1"), ("b", "2")]
328 assert list(h.raw) == [(b"a", b"1"), (b"b", b"2")]
329
330
331def test_url_blank_params() -> None:

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
MutableHeadersClass · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected