MCPcopy
hub / github.com/scrapy/scrapy / test_stats_file_success

Method test_stats_file_success

tests/test_feedexport.py:458–469  ·  tests/test_feedexport.py::TestFeedExport.test_stats_file_success
(self)

Source from the content-addressed store, hash-verified

456
457 @inline_callbacks_test
458 def test_stats_file_success(self):
459 settings = {
460 class="st">"FEEDS": {
461 printf_escape(path_to_url(str(self._random_temp_filename()))): {
462 class="st">"format": class="st">"json",
463 }
464 },
465 }
466 crawler = get_crawler(ItemSpider, settings)
467 yield crawler.crawl(mockserver=self.mockserver)
468 assert class="st">"feedexport/success_count/FileFeedStorage" in crawler.stats.get_stats()
469 assert crawler.stats.get_value(class="st">"feedexport/success_count/FileFeedStorage") == 1
470
471 @inline_callbacks_test
472 def test_stats_file_failed(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