MCPcopy
hub / github.com/scrapy/scrapy / test_get_sitemap_body

Method test_get_sitemap_body

tests/test_spider_sitemap.py:37–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 assert spider._get_sitemap_body(response) == body
36
37 def test_get_sitemap_body(self):
38 r = XmlResponse(url="http://www.example.com/", body=self.BODY)
39 self.assertSitemapBody(r, self.BODY)
40
41 r = HtmlResponse(url="http://www.example.com/", body=self.BODY)
42 self.assertSitemapBody(r, None)
43
44 r = Response(url="http://www.example.com/favicon.ico", body=self.BODY)
45 self.assertSitemapBody(r, None)
46
47 r = XmlResponse(url="http://www.example.com/", body=b"")
48 self.assertSitemapBody(r, b"")
49
50 def test_get_sitemap_body_gzip_headers(self):
51 r = Response(

Callers

nothing calls this directly

Calls 4

assertSitemapBodyMethod · 0.95
XmlResponseClass · 0.90
HtmlResponseClass · 0.90
ResponseClass · 0.90

Tested by

no test coverage detected