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

Function test_headers_mutablecopy

tests/test_datastructures.py:313–318  ·  tests/test_datastructures.py::test_headers_mutablecopy
()

Source from the content-addressed store, hash-verified

311
312
313def test_headers_mutablecopy() -> None:
314 h = Headers(raw=[(bclass="st">"a", bclass="st">"123"), (bclass="st">"a", bclass="st">"456"), (bclass="st">"b", bclass="st">"789")])
315 c = h.mutablecopy()
316 assert c.items() == [(class="st">"a", class="st">"123"), (class="st">"a", class="st">"456"), (class="st">"b", class="st">"789")]
317 c[class="st">"a"] = class="st">"abc"
318 assert c.items() == [(class="st">"a", class="st">"abc"), (class="st">"b", class="st">"789")]
319
320
321def test_mutable_headers_from_scope() -> None:

Callers

nothing calls this directly

Calls 3

mutablecopyMethod · 0.95
HeadersClass · 0.90
itemsMethod · 0.45

Tested by

no test coverage detected