MCPcopy
hub / github.com/scrapy/scrapy / test_compression_bomb_setting

Method test_compression_bomb_setting

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

Source from the content-addressed store, hash-verified

310 assert urls == result
311
312 def test_compression_bomb_setting(self):
313 settings = {"DOWNLOAD_MAXSIZE": 10_000_000}
314 crawler = get_crawler(settings_dict=settings)
315 spider = self.spider_class.from_crawler(crawler, "example.com")
316 body_path = Path(tests_datadir, "compressed", "bomb-gzip.bin")
317 body = body_path.read_bytes()
318 request = Request(url="https://example.com")
319 response = Response(url="https://example.com", body=body, request=request)
320 assert spider._get_sitemap_body(response) is None
321
322 @pytest.mark.filterwarnings("ignore::scrapy.exceptions.ScrapyDeprecationWarning")
323 def test_compression_bomb_spider_attr(self):

Callers

nothing calls this directly

Calls 5

get_crawlerFunction · 0.90
RequestClass · 0.90
ResponseClass · 0.90
_get_sitemap_bodyMethod · 0.80
from_crawlerMethod · 0.45

Tested by

no test coverage detected