MCPcopy
hub / github.com/scrapy/scrapy / _assert_stores

Method _assert_stores

tests/test_feedexport_storages.py:100–111  ·  view source on GitHub ↗
(
        storage: FileFeedStorage, path: Path, expected_content: bytes = b"content"
    )

Source from the content-addressed store, hash-verified

98
99 @staticmethod
100 def _assert_stores(
101 storage: FileFeedStorage, path: Path, expected_content: bytes = b"content"
102 ) -> None:
103 spider = scrapy.Spider("default")
104 file = storage.open(spider)
105 file.write(b"content")
106 storage.store(file)
107 assert path.exists()
108 try:
109 assert path.read_bytes() == expected_content
110 finally:
111 path.unlink()
112
113 def test_preserves_windows_path_without_file_scheme(self):
114 path = r"C:\Users\user\Desktop\test.txt"

Callers 6

test_store_file_uriMethod · 0.95
test_appendMethod · 0.95
test_overwriteMethod · 0.95

Calls 3

openMethod · 0.45
writeMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected