def test_thaw(): cp = get_test_config() old_tree = tree.Tree() st = storage.FakeStorage(cp) ar = archiver.Archiver(cp, 0, TESTFILES_TGT, st) with closing(ar): new_tree = do_freeze(cp, old_tree, TESTFILES_PATH, ar, {'target-name': TESTFILES_TGT}) storage.store_local_tree(cp, TESTFILES_TGT, new_tree) # Thaw the new tree print("\nThawing") loaded_tree = storage.load_local_tree(cp, TESTFILES_TGT) thaw.do_thaw(cp, loaded_tree, TESTFILES_THAW_PATH, st)
def testThawLocal(self): conf = get_test_config() with conf: conf.st = LocalStorage(conf, conf.tempdir("testThawLocal")) old_tree = tree.Tree() new_tree = do_freeze(conf, old_tree, TEST_FILES_TGT) tree.print_tree(new_tree) # Now thaw thawdir = conf.tempdir("thaw_dir") do_thaw(conf, new_tree, thawdir) # Directory diff for (full_path, target_path) in files_to_consider(conf, TEST_FILES_TGT): fthaw = os.path.join(thawdir, target_path[1:]) self.assertTrue(filecmp.cmp(full_path, fthaw))