MCPcopy
hub / github.com/urllib3/urllib3 / test_create_from_headerdict

Method test_create_from_headerdict

test/test_collections.py:194–211  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

192 assert clist[-1] == "E"
193
194 def test_create_from_headerdict(self) -> None:
195 headers = [
196 ("ab", "A"),
197 ("cd", "B"),
198 ("cookie", "C"),
199 ("cookie", "D"),
200 ("cookie", "E"),
201 ]
202 org = HTTPHeaderDict(headers)
203 h = HTTPHeaderDict(org)
204 assert len(h) == 3
205 assert "ab" in h
206 clist = h.getlist("cookie")
207 assert len(clist) == 3
208 assert clist[0] == "C"
209 assert clist[-1] == "E"
210 assert h is not org
211 assert h == org
212
213 def test_setitem(self, d: HTTPHeaderDict) -> None:
214 d["Cookie"] = "foo"

Callers

nothing calls this directly

Calls 2

getlistMethod · 0.95
HTTPHeaderDictClass · 0.90

Tested by

no test coverage detected