(self)
| 256 | assert urls == result |
| 257 | |
| 258 | def test_parse_sitemap_empty_body(self): |
| 259 | r = XmlResponse(url="http://www.example.com/sitemap.xml", body=b"") |
| 260 | spider = self.spider_class("example.com") |
| 261 | |
| 262 | with LogCapture() as lc: |
| 263 | results = list(spider._parse_sitemap(r)) |
| 264 | |
| 265 | assert not results |
| 266 | |
| 267 | lc.check( |
| 268 | ( |
| 269 | "scrapy.spiders.sitemap", |
| 270 | "WARNING", |
| 271 | "Ignoring invalid sitemap: <200 http://www.example.com/sitemap.xml>", |
| 272 | ) |
| 273 | ) |
| 274 | |
| 275 | def test_parse_sitemap_not_sitemap(self): |
| 276 | body = b"""<?xml version="1.0" encoding="UTF-8"?> |
nothing calls this directly
no test coverage detected