MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_items

Method test_items

test/mitmproxy/test_http.py:851–867  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

849 assert headers.fields == ((b"Host", b"example.com"), (b"Accept", b"text/plain"))
850
851 def test_items(self):
852 headers = Headers(
853 [
854 (b"Set-Cookie", b"foo"),
855 (b"Set-Cookie", b"bar"),
856 (b"Accept", b"text/plain"),
857 ]
858 )
859 assert list(headers.items()) == [
860 ("Set-Cookie", "foo, bar"),
861 ("Accept", "text/plain"),
862 ]
863 assert list(headers.items(multi=True)) == [
864 ("Set-Cookie", "foo"),
865 ("Set-Cookie", "bar"),
866 ("Accept", "text/plain"),
867 ]
868
869
870def _test_passthrough_attr(message: Message, attr: str, value: Any = b"foo") -> None:

Callers

nothing calls this directly

Calls 2

itemsMethod · 0.95
HeadersClass · 0.90

Tested by

no test coverage detected