(
storage: FileFeedStorage, path: Path, expected_content: bytes = b"content"
)
| 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" |
no test coverage detected