MCPcopy
hub / github.com/scrapy/scrapy / test_multivalue

Method test_multivalue

tests/test_http_headers.py:36–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 assert h.getlist("Content-Type") == [b"text/html"]
35
36 def test_multivalue(self):
37 h = Headers()
38 h["X-Forwarded-For"] = hlist = ["ip1", "ip2"]
39 assert h["X-Forwarded-For"] == b"ip2"
40 assert h.get("X-Forwarded-For") == b"ip2"
41 assert h.getlist("X-Forwarded-For") == [b"ip1", b"ip2"]
42 assert h.getlist("X-Forwarded-For") is not hlist
43
44 def test_multivalue_for_one_header(self):
45 h = Headers((("a", "b"), ("a", "c")))

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
getlistMethod · 0.95
HeadersClass · 0.90

Tested by

no test coverage detected