MCPcopy Create free account
hub / github.com/encode/starlette / test_headers_mutablecopy

Function test_headers_mutablecopy

tests/test_datastructures.py:365–370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363
364
365def test_headers_mutablecopy() -> None:
366 h = Headers(raw=[(b"a", b"123"), (b"a", b"456"), (b"b", b"789")])
367 c = h.mutablecopy()
368 assert c.items() == [("a", "123"), ("a", "456"), ("b", "789")]
369 c["a"] = "abc"
370 assert c.items() == [("a", "abc"), ("b", "789")]
371
372
373def 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