MCPcopy
hub / github.com/scrapy/scrapy / test_export_items

Method test_export_items

tests/test_feedexport_batch.py:197–211  ·  view source on GitHub ↗

Test partial deliveries in all supported formats

(self)

Source from the content-addressed store, hash-verified

195
196 @coroutine_test
197 async def test_export_items(self):
198 """Test partial deliveries in all supported formats"""
199 items = [
200 self.MyItem({"foo": "bar1", "egg": "spam1"}),
201 self.MyItem({"foo": "bar2", "egg": "spam2", "baz": "quux2"}),
202 self.MyItem({"foo": "bar3", "baz": "quux3"}),
203 ]
204 rows = [
205 {"egg": "spam1", "foo": "bar1", "baz": ""},
206 {"egg": "spam2", "foo": "bar2", "baz": "quux2"},
207 {"foo": "bar3", "baz": "quux3", "egg": ""},
208 ]
209 settings = {"FEED_EXPORT_BATCH_ITEM_COUNT": 2}
210 header = self.MyItem.fields.keys()
211 await self.assertExported(items, header, rows, settings=settings)
212
213 def test_wrong_path(self):
214 """If path is without %(batch_time)s and %(batch_id) an exception must be raised"""

Callers

nothing calls this directly

Calls 2

keysMethod · 0.80
assertExportedMethod · 0.80

Tested by

no test coverage detected