Skip to content

Commit 0021859

Browse files
committed
Limit fields checked in ZIP tests
1 parent 4b4195d commit 0021859

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

fsspec/asyn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ async def _rm(self, path, recursive=False, batch_size=None, **kwargs):
344344
async def _cp_file(self, path1, path2, **kwargs):
345345
raise NotImplementedError
346346

347+
async def _mv_file(self, path1, path2):
348+
await self._cp_file(path1, path2)
349+
await self._rm_file(path1)
350+
347351
async def _copy(
348352
self,
349353
path1,

fsspec/implementations/tests/test_zip.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,25 @@ def zip_file_fixture(tmp_path):
164164
def _assert_all_except_context_dependent_variables(result, expected_result):
165165
for path in expected_result.keys():
166166
assert result[path]
167-
result_without_date_time = result[path].copy()
168-
result_without_date_time.pop("date_time")
169-
result_without_date_time.pop("_raw_time")
170-
result_without_date_time.pop("external_attr")
171-
result_without_date_time.pop("create_system")
172-
result_without_date_time.pop("_end_offset", None)
173-
result_without_date_time.pop("header_offset", None)
174-
175-
expected_result_without_date_time = expected_result[path].copy()
176-
expected_result_without_date_time.pop("date_time")
177-
expected_result_without_date_time.pop("_raw_time")
178-
expected_result_without_date_time.pop("external_attr")
179-
expected_result_without_date_time.pop("create_system")
180-
expected_result_without_date_time.pop("_end_offset", None)
181-
expected_result_without_date_time.pop("header_offset", None)
167+
fields = [
168+
"orig_filename",
169+
"filename",
170+
"compress_type",
171+
"comment",
172+
"extra",
173+
"CRC",
174+
"compress_size",
175+
"file_size",
176+
"name",
177+
"size",
178+
"type",
179+
]
180+
181+
result_without_date_time = {k: result[path][k] for k in fields}
182+
183+
expected_result_without_date_time = {
184+
k: expected_result[path][k] for k in fields
185+
}
182186
assert result_without_date_time == expected_result_without_date_time
183187

184188

0 commit comments

Comments
 (0)