diff --git a/fsspec/asyn.py b/fsspec/asyn.py index f203fa0a4..de41839ea 100644 --- a/fsspec/asyn.py +++ b/fsspec/asyn.py @@ -344,6 +344,10 @@ async def _rm(self, path, recursive=False, batch_size=None, **kwargs): async def _cp_file(self, path1, path2, **kwargs): raise NotImplementedError + async def _mv_file(self, path1, path2): + await self._cp_file(path1, path2) + await self._rm_file(path1) + async def _copy( self, path1, diff --git a/fsspec/implementations/tests/test_zip.py b/fsspec/implementations/tests/test_zip.py index 8bf8155d9..14d00086e 100644 --- a/fsspec/implementations/tests/test_zip.py +++ b/fsspec/implementations/tests/test_zip.py @@ -164,21 +164,25 @@ def zip_file_fixture(tmp_path): def _assert_all_except_context_dependent_variables(result, expected_result): for path in expected_result.keys(): assert result[path] - result_without_date_time = result[path].copy() - result_without_date_time.pop("date_time") - result_without_date_time.pop("_raw_time") - result_without_date_time.pop("external_attr") - result_without_date_time.pop("create_system") - result_without_date_time.pop("_end_offset", None) - result_without_date_time.pop("header_offset", None) - - expected_result_without_date_time = expected_result[path].copy() - expected_result_without_date_time.pop("date_time") - expected_result_without_date_time.pop("_raw_time") - expected_result_without_date_time.pop("external_attr") - expected_result_without_date_time.pop("create_system") - expected_result_without_date_time.pop("_end_offset", None) - expected_result_without_date_time.pop("header_offset", None) + fields = [ + "orig_filename", + "filename", + "compress_type", + "comment", + "extra", + "CRC", + "compress_size", + "file_size", + "name", + "size", + "type", + ] + + result_without_date_time = {k: result[path][k] for k in fields} + + expected_result_without_date_time = { + k: expected_result[path][k] for k in fields + } assert result_without_date_time == expected_result_without_date_time