Skip to content

Commit b466bcb

Browse files
author
atollk
committed
Added preserve_time parameter that was missing from MemoryFS.move and MemoryFS.movedir.
1 parent cf62a83 commit b466bcb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

fs/memoryfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def makedir(
444444
parent_dir.set_entry(dir_name, new_dir)
445445
return self.opendir(path)
446446

447-
def move(self, src_path, dst_path, overwrite=False):
447+
def move(self, src_path, dst_path, overwrite=False, preserve_time=False):
448448
src_dir, src_name = split(self.validatepath(src_path))
449449
dst_dir, dst_name = split(self.validatepath(dst_path))
450450

@@ -465,7 +465,7 @@ def move(self, src_path, dst_path, overwrite=False):
465465
dst_dir_entry.set_entry(dst_name, src_entry)
466466
src_dir_entry.remove_entry(src_name)
467467

468-
def movedir(self, src_path, dst_path, create=False):
468+
def movedir(self, src_path, dst_path, create=False, preserve_time=False):
469469
src_dir, src_name = split(self.validatepath(src_path))
470470
dst_dir, dst_name = split(self.validatepath(dst_path))
471471

tests/test_osfs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def test_copy_preserve_time(self):
113113

114114
dst_info = self.fs.getinfo("bar/file.txt", namespaces)
115115
self.assertEqual(dst_info.modified, src_info.modified)
116-
self.assertEqual(dst_info.accessed, src_info.accessed)
117116
self.assertEqual(dst_info.metadata_changed, src_info.metadata_changed)
118117

119118
@unittest.skipUnless(osfs.sendfile, "sendfile not supported")

0 commit comments

Comments
 (0)