MCPcopy
hub / github.com/scrapy/scrapy / assertSitemapBody

Method assertSitemapBody

tests/test_spider_sitemap.py:32–35  ·  view source on GitHub ↗
(self, response: Response, body: bytes | None)

Source from the content-addressed store, hash-verified

30 GZBODY = f.getvalue()
31
32 def assertSitemapBody(self, response: Response, body: bytes | None) -> None:
33 crawler = get_crawler()
34 spider = self.spider_class.from_crawler(crawler, "example.com")
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)

Calls 3

get_crawlerFunction · 0.90
_get_sitemap_bodyMethod · 0.80
from_crawlerMethod · 0.45

Tested by

no test coverage detected