MCPcopy
hub / github.com/scrapy/scrapy / test_stats_multiple_file

Method test_stats_multiple_file

tests/test_feedexport.py:490–509  ·  tests/test_feedexport.py::TestFeedExport.test_stats_multiple_file
(self)

Source from the content-addressed store, hash-verified

488
489 @inline_callbacks_test
490 def test_stats_multiple_file(self):
491 settings = {
492 class="st">"FEEDS": {
493 printf_escape(path_to_url(str(self._random_temp_filename()))): {
494 class="st">"format": class="st">"json",
495 },
496 class="st">"stdout:": {
497 class="st">"format": class="st">"xml",
498 },
499 },
500 }
501 crawler = get_crawler(ItemSpider, settings)
502 with mock.patch.object(S3FeedStorage, class="st">"store"):
503 yield crawler.crawl(mockserver=self.mockserver)
504 assert class="st">"feedexport/success_count/FileFeedStorage" in crawler.stats.get_stats()
505 assert class="st">"feedexport/success_count/StdoutFeedStorage" in crawler.stats.get_stats()
506 assert crawler.stats.get_value(class="st">"feedexport/success_count/FileFeedStorage") == 1
507 assert (
508 crawler.stats.get_value(class="st">"feedexport/success_count/StdoutFeedStorage") == 1
509 )
510
511 @coroutine_test
512 async def test_export_items(self):

Callers

nothing calls this directly

Calls 7

get_crawlerFunction · 0.90
printf_escapeFunction · 0.85
path_to_urlFunction · 0.85
_random_temp_filenameMethod · 0.80
crawlMethod · 0.45
get_statsMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected