# Path: duplicity/collections.py
# class CollectionsError(Exception):
# class BackupSet:
# class BackupChain:
# class SignatureChain:
# class CollectionsStatus:
#     def __init__(self, backend):
#     def is_complete(self):
#     def add_filename(self, filename):
#     def set_info(self, pr):
#     def set_manifest(self, remote_filename):
#     def delete(self):
#     def __str__(self):
#     def get_timestr(self):
#     def check_manifests(self):
#     def get_local_manifest(self):
#     def get_remote_manifest(self):
#     def get_manifest(self):
#     def get_filenames(self):
#     def get_time(self):
#     def __len__(self):
#     def __init__(self, backend):
#     def set_full(self, fullset):
#     def add_inc(self, incset):
#     def delete(self):
#     def get_sets_at_time(self, time):
#     def get_last(self):
#     def get_first(self):
#     def short_desc(self):
#     def to_log_info(self, prefix=''):
#     def __str__(self):
#     def get_num_volumes(self):
#     def get_all_sets(self):
#     def __init__(self, local, location):
#     def __str__(self):
#     def check_times(self, time_list):
#     def islocal(self):
#     def add_filename(self, filename, pr = None):
#     def get_fileobjs(self, time = None):
#             def filename_to_fileobj(filename):
#     def delete(self):
#     def get_filenames(self, time = None):
#     def __init__(self, backend, archive_dir):
#     def to_log_info(self):
#     def __str__(self):
#     def set_values(self, sig_chain_warning = 1):
#     def set_matched_chain_pair(self, sig_chains, backup_chains):
#     def warn(self, sig_chain_warning):
#     def get_backup_chains(self, filename_list):
#         def add_to_sets(filename):
#         def add_to_chains(set):
#     def get_sorted_sets(self, set_list):
#     def get_signature_chains(self, local, filelist = None):
#         def get_filelist():
#         def get_new_sigchain():
#         def by_start_time(a, b):
#     def get_sorted_chains(self, chain_list):
#     def get_backup_chain_at_time(self, time):
#     def get_signature_chain_at_time(self, time):
#     def get_extraneous(self, extra_clean):
#     def sort_sets(self, setlist):
#     def get_chains_older_than(self, t):
#     def get_last_full_backup_time(self):
#     def get_nth_last_full_backup_time(self, n):
#     def get_last_backup_chain(self):
#     def get_nth_last_backup_chain(self,n):
#         def mycmp(x, y):
#     def get_older_than(self, t):
#     def get_older_than_required(self, t):
# 
# Path: duplicity/globals.py



import config
import sys, os, unittest
import duplicity.backend
from duplicity import path
from duplicity import collections
from duplicity import commandline
from duplicity import globals
        lf4_1 = lf3.append("SYMLINK--------------------------------------------------------------------------------------------")
        os.symlink("SYMLINK-DESTINATION-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", lf4_1.name)
        lf4_1.setdata()
        assert lf4_1.issym()
        lf4_2 = lf3.append("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD")
        fp = lf4_2.open("wb")
        fp.write("hello" * 1000)
        assert not fp.close()

        self.runtest(["testfiles/empty_dir", lf_dir.name,
                      "testfiles/empty_dir", lf_dir.name])

    def test_empty_restore(self):
        """Make sure error raised when restore doesn't match anything"""
        self.deltmp()
        self.backup("full", "testfiles/dir1")
        self.assertRaises(CmdError, self.restore, "this_file_does_not_exist")
        self.backup("inc", "testfiles/empty_dir")
        self.assertRaises(CmdError, self.restore, "this_file_does_not_exist")

    def test_remove_older_than(self):
        """Test removing old backup chains"""
        self.deltmp()
        self.backup("full", "testfiles/dir1", current_time = 10000)
        self.backup("inc", "testfiles/dir2", current_time = 20000)
        self.backup("full", "testfiles/dir1", current_time = 30000)
        self.backup("inc", "testfiles/dir3", current_time = 40000)

        b = duplicity.backend.get_backend(backend_url)
        commandline.set_archive_dir("testfiles/cache")

# Path: duplicity/collections.py
# class CollectionsError(Exception):
# class BackupSet:
# class BackupChain:
# class SignatureChain:
# class CollectionsStatus:
#     def __init__(self, backend):
#     def is_complete(self):
#     def add_filename(self, filename):
#     def set_info(self, pr):
#     def set_manifest(self, remote_filename):
#     def delete(self):
#     def __str__(self):
#     def get_timestr(self):
#     def check_manifests(self):
#     def get_local_manifest(self):
#     def get_remote_manifest(self):
#     def get_manifest(self):
#     def get_filenames(self):
#     def get_time(self):
#     def __len__(self):
#     def __init__(self, backend):
#     def set_full(self, fullset):
#     def add_inc(self, incset):
#     def delete(self):
#     def get_sets_at_time(self, time):
#     def get_last(self):
#     def get_first(self):
#     def short_desc(self):
#     def to_log_info(self, prefix=''):
#     def __str__(self):
#     def get_num_volumes(self):
#     def get_all_sets(self):
#     def __init__(self, local, location):
#     def __str__(self):
#     def check_times(self, time_list):
#     def islocal(self):
#     def add_filename(self, filename, pr = None):
#     def get_fileobjs(self, time = None):
#             def filename_to_fileobj(filename):
#     def delete(self):
#     def get_filenames(self, time = None):
#     def __init__(self, backend, archive_dir):
#     def to_log_info(self):
#     def __str__(self):
#     def set_values(self, sig_chain_warning = 1):
#     def set_matched_chain_pair(self, sig_chains, backup_chains):
#     def warn(self, sig_chain_warning):
#     def get_backup_chains(self, filename_list):
#         def add_to_sets(filename):
#         def add_to_chains(set):
#     def get_sorted_sets(self, set_list):
#     def get_signature_chains(self, local, filelist = None):
#         def get_filelist():
#         def get_new_sigchain():
#         def by_start_time(a, b):
#     def get_sorted_chains(self, chain_list):
#     def get_backup_chain_at_time(self, time):
#     def get_signature_chain_at_time(self, time):
#     def get_extraneous(self, extra_clean):
#     def sort_sets(self, setlist):
#     def get_chains_older_than(self, t):
#     def get_last_full_backup_time(self):
#     def get_nth_last_full_backup_time(self, n):
#     def get_last_backup_chain(self):
#     def get_nth_last_backup_chain(self,n):
#         def mycmp(x, y):
#     def get_older_than(self, t):
#     def get_older_than_required(self, t):
# 
# Path: duplicity/globals.py



# Path: testing/finaltest.py
import config
import sys, os, unittest
import duplicity.backend
from duplicity import path
from duplicity import collections
from duplicity import commandline
from duplicity import globals

        lf4_1 = lf3.append("SYMLINK--------------------------------------------------------------------------------------------")
        os.symlink("SYMLINK-DESTINATION-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------", lf4_1.name)
        lf4_1.setdata()
        assert lf4_1.issym()
        lf4_2 = lf3.append("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD")
        fp = lf4_2.open("wb")
        fp.write("hello" * 1000)
        assert not fp.close()

        self.runtest(["testfiles/empty_dir", lf_dir.name,
                      "testfiles/empty_dir", lf_dir.name])

    def test_empty_restore(self):
        """Make sure error raised when restore doesn't match anything"""
        self.deltmp()
        self.backup("full", "testfiles/dir1")
        self.assertRaises(CmdError, self.restore, "this_file_does_not_exist")
        self.backup("inc", "testfiles/empty_dir")
        self.assertRaises(CmdError, self.restore, "this_file_does_not_exist")

    def test_remove_older_than(self):
        """Test removing old backup chains"""
        self.deltmp()
        self.backup("full", "testfiles/dir1", current_time = 10000)
        self.backup("inc", "testfiles/dir2", current_time = 20000)
        self.backup("full", "testfiles/dir1", current_time = 30000)
        self.backup("inc", "testfiles/dir3", current_time = 40000)

        b = duplicity.backend.get_backend(backend_url)
        commandline.set_archive_dir("testfiles/cache")

        cs = collections.CollectionsStatus(b, globals.archive_dir).set_values()