From: Eduardo Robles Elvira Date: Tue, 6 Aug 2013 07:49:35 +0000 (+0200) Subject: improving diff engine unit test so that it test deletion of files X-Git-Tag: v2.2~120 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=0519f16108c308cc9c133d7b5054d85f4218378a;p=python-delta-tar improving diff engine unit test so that it test deletion of files --- diff --git a/testing/test_deltatar.py b/testing/test_deltatar.py index 7ba5c0b..447eac3 100644 --- a/testing/test_deltatar.py +++ b/testing/test_deltatar.py @@ -895,6 +895,7 @@ class DeltaTarTest(BaseTest): # add some new files and directories os.makedirs('source_dir/bigdir') self.hash["source_dir/bigdir"] = "" + os.unlink("source_dir/small") self.hash["source_dir/bigdir/a"] = self.create_file("source_dir/bigdir/a", 100) self.hash["source_dir/bigdir/b"] = self.create_file("source_dir/bigdir/b", 500) self.hash["source_dir/zzzz"] = self.create_file("source_dir/zzzz", 100) @@ -908,7 +909,7 @@ class DeltaTarTest(BaseTest): assert [i[0]['path'] for i in index_it] == [ 'list://./big', 'snapshot://./bigdir', - 'list://./small', + 'delete://./small', 'list://./test', 'snapshot://./zzzz', 'list://./test/huge', @@ -922,6 +923,11 @@ class DeltaTarTest(BaseTest): assert os.path.exists("backup_dir2") shutil.rmtree("source_dir") + # create source_dir with the small file, that will be then deleted by + # the restore_backup + os.mkdir("source_dir") + open("source_dir/small", 'w').close() + tar_filename = deltatar.volume_name_func('backup_dir2', True, 0) tar_path = os.path.join("backup_dir2", tar_filename)