示例#1
0
def test_freeze(configname):
    if configname is None:
        cp = get_test_config()
        st = storage.FakeStorage(cp)
    else:
        cp = load_config(configname)
        set_default_options(cp)
        st = storage.AmazonStorage(cp)

    old_tree = tree.Tree()
    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})
        print()
        tree.print_tree(new_tree)
示例#2
0
    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))