(self, items, rows, settings=None)
| 174 | assert got_batch == expected_batch |
| 175 | |
| 176 | async def assertExportedMarshal(self, items, rows, settings=None): |
| 177 | settings = settings or {} |
| 178 | settings.update( |
| 179 | { |
| 180 | "FEEDS": { |
| 181 | self._random_temp_filename() / "marshal" / self._file_mark: { |
| 182 | "format": "marshal" |
| 183 | }, |
| 184 | }, |
| 185 | } |
| 186 | ) |
| 187 | batch_size = Settings(settings).getint("FEED_EXPORT_BATCH_ITEM_COUNT") |
| 188 | rows = [{k: v for k, v in row.items() if v} for row in rows] |
| 189 | data = await self.exported_data(items, settings) |
| 190 | |
| 191 | for batch in data["marshal"]: |
| 192 | got_batch = self._load_until_eof(batch, load_func=marshal.load) |
| 193 | expected_batch, rows = rows[:batch_size], rows[batch_size:] |
| 194 | assert got_batch == expected_batch |
| 195 | |
| 196 | @coroutine_test |
| 197 | async def test_export_items(self): |
nothing calls this directly
no test coverage detected