MCPcopy
hub / github.com/scrapy/scrapy / test_get_header

Method test_get_header

tests/test_http_cookies.py:41–50  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 assert not self.wrapped.has_header("xxxxx")
40
41 def test_get_header(self):
42 assert self.wrapped.get_header("content-type") == "text/html"
43 assert self.wrapped.get_header("xxxxx", "def") == "def"
44 assert self.wrapped.get_header("xxxxx") is None
45 wrapped = WrappedRequest(
46 Request(
47 "http://www.example.com/page.html", headers={"empty-binary-header": b""}
48 )
49 )
50 assert wrapped.get_header("empty-binary-header") == ""
51
52 def test_header_items(self):
53 assert self.wrapped.header_items() == [("Content-Type", ["text/html"])]

Callers

nothing calls this directly

Calls 3

get_headerMethod · 0.95
WrappedRequestClass · 0.90
RequestClass · 0.90

Tested by

no test coverage detected