MCPcopy
hub / github.com/scrapy/scrapy / test_start_finish_exporting_items

Method test_start_finish_exporting_items

tests/test_feedexport.py:538–555  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

536
537 @coroutine_test
538 async def test_start_finish_exporting_items(self):
539 items = [
540 self.MyItem({"foo": "bar1", "egg": "spam1"}),
541 ]
542 settings = {
543 "FEEDS": {
544 self._random_temp_filename(): {"format": "json"},
545 },
546 "FEED_EXPORT_INDENT": None,
547 }
548
549 listener = IsExportingListener()
550 InstrumentedFeedSlot.subscribe__listener(listener)
551
552 with mock.patch("scrapy.extensions.feedexport.FeedSlot", InstrumentedFeedSlot):
553 await self.exported_data(items, settings)
554 assert not listener.start_without_finish
555 assert not listener.finish_without_start
556
557 @coroutine_test
558 async def test_start_finish_exporting_no_items(self):

Callers

nothing calls this directly

Calls 4

IsExportingListenerClass · 0.85
_random_temp_filenameMethod · 0.80
subscribe__listenerMethod · 0.80
exported_dataMethod · 0.80

Tested by

no test coverage detected