Beispiel #1
0
 def test_only_newer(self):
     """
     merge_tree should accept a copy_function in which only
     newer files are copied and older files do not overwrite
     newer copies in the dest.
     """
     target = self.subdir_b / 'testfile.txt'
     target.write_text('this is newer')
     self.subdir_a.merge_tree(self.subdir_b,
                              copy_function=path.only_newer(shutil.copy2))
     assert target.read_text() == 'this is newer'
Beispiel #2
0
 def test_only_newer(self):
     """
     merge_tree should accept a copy_function in which only
     newer files are copied and older files do not overwrite
     newer copies in the dest.
     """
     target = self.subdir_b / 'testfile.txt'
     target.write_text('this is newer')
     self.subdir_a.merge_tree(
         self.subdir_b,
         copy_function=path.only_newer(shutil.copy2),
     )
     assert target.text() == 'this is newer'