예제 #1
0
파일: test_path.py 프로젝트: louis-ng/path
 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'
예제 #2
0
파일: test_path.py 프로젝트: jaraco/path.py
 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'