Example #1
0
def test_storage():
    cp = get_test_config()

    t = tree.Tree()
    t.files['/test'] = tree.UukeyStorage(False, 0)
    storage.store_local_tree(cp, TESTFILES_TGT, t)
    print(os.path.isfile(storage.local_tree_fname(cp, TESTFILES_TGT)))

    nt = storage.load_local_tree(cp, TESTFILES_TGT)
    print(nt == t)
    print(t.files)
    print(nt.files)
Example #2
0
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)