MCPcopy
hub / github.com/scrapy/scrapy / test_export_dicts

Method test_export_dicts

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

Source from the content-addressed store, hash-verified

840
841 @coroutine_test
842 async def test_export_dicts(self):
843 # When dicts are used, only keys from the first row are used as
844 # a header for CSV, and all fields are used for JSON Lines.
845 items = [
846 {"foo": "bar", "egg": "spam"},
847 {"foo": "bar", "egg": "spam", "baz": "quux"},
848 ]
849 rows_csv = [{"egg": "spam", "foo": "bar"}, {"egg": "spam", "foo": "bar"}]
850 rows_jl = items
851 await self.assertExportedCsv(items, ["foo", "egg"], rows_csv)
852 await self.assertExportedJsonLines(items, rows_jl)
853
854 @coroutine_test
855 async def test_export_tuple(self):

Callers

nothing calls this directly

Calls 2

assertExportedCsvMethod · 0.95

Tested by

no test coverage detected