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

Function test_headers_mutablecopy

tests/test_datastructures.py:313–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311
312
313def test_headers_mutablecopy() -> None:
314 h = Headers(raw=[(b"a", b"123"), (b"a", b"456"), (b"b", b"789")])
315 c = h.mutablecopy()
316 assert c.items() == [("a", "123"), ("a", "456"), ("b", "789")]
317 c["a"] = "abc"
318 assert c.items() == [("a", "abc"), ("b", "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