MCPcopy
hub / github.com/scrapy/scrapy / assertExportedPickle

Method assertExportedPickle

tests/test_feedexport.py:417–435  ·  view source on GitHub ↗
(
        self,
        items: Iterable[Any],
        rows: Iterable[dict[str, Any]],
        settings: dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

415 assert rows == json_rows
416
417 async def assertExportedPickle(
418 self,
419 items: Iterable[Any],
420 rows: Iterable[dict[str, Any]],
421 settings: dict[str, Any] | None = None,
422 ) -> None:
423 settings = settings or {}
424 settings.update(
425 {
426 "FEEDS": {
427 self._random_temp_filename(): {"format": "pickle"},
428 },
429 }
430 )
431 data = await self.exported_data(items, settings)
432 expected = [{k: v for k, v in row.items() if v} for row in rows]
433
434 result = self._load_until_eof(data["pickle"], load_func=pickle.load)
435 assert result == expected
436
437 async def assertExportedMarshal(
438 self,

Callers

nothing calls this directly

Calls 5

_random_temp_filenameMethod · 0.80
exported_dataMethod · 0.80
itemsMethod · 0.80
_load_until_eofMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected