MCPcopy
hub / github.com/scrapy/scrapy / test_none_value

Method test_none_value

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

Source from the content-addressed store, hash-verified

136 assert h1.getlist("header2") == [b"value2", b"value3"]
137
138 def test_none_value(self):
139 h1 = Headers()
140 h1["foo"] = "bar"
141 h1["foo"] = None
142 h1.setdefault("foo", "bar")
143 assert h1.get("foo") is None
144 assert h1.getlist("foo") == []
145
146 def test_int_value(self):
147 h1 = Headers({"hey": 5})

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
getlistMethod · 0.95
HeadersClass · 0.90
setdefaultMethod · 0.45

Tested by

no test coverage detected