# 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/gpg.py
# class GPGError(Exception):
# class GPGProfile:
# class GPGFile:
#     class FileCounted:
#     def __init__(self, passphrase = None, sign_key = None,
#                  recipients = None):
#     def __init__(self, encrypt, encrypt_path, profile):
#     def read(self, length = -1):
#     def write(self, buf):
#     def gpg_failed(self):
#     def close(self):
#     def set_signature(self):
#     def get_signature(self):
# def GPGWriteFile(block_iter, filename, profile,
#                  size = 200 * 1024 * 1024,
#                  max_footer_size = 16 * 1024):
#     def top_off(bytes, file):
#     def get_current_size():
# def GzipWriteFile(block_iter, filename,
#                   size = 200 * 1024 * 1024,
#                   max_footer_size = 16 * 1024):
#         def __init__(self, fileobj):
#         def write(self, buf):
#         def close(self):
# def get_hash(hash, path, hex = 1):
# 
# Path: duplicity/globals.py



import config
import os, sys, random, unittest
from duplicity import collections
from duplicity import backend
from duplicity import path
from duplicity import gpg
from duplicity import globals
from duplicity import dup_time
                                           "/archive_dir")

dummy_backend = None
real_backend = backend.get_backend("file://%s/%s" %
                                   (col_test_dir.name, "remote_dir"))
output_dir = path.Path("testfiles/output") # used as a temp directory
output_dir_backend = backend.get_backend("file://testfiles/output")


class CollectionTest(unittest.TestCase):
    """Test collections"""
    def setUp(self):
        assert not os.system("tar xzf testfiles.tar.gz > /dev/null 2>&1")
        assert not os.system("mkdir testfiles/output")

    def tearDown(self):
        assert not os.system("rm -rf testfiles tempdir temp2.tar")

    def del_tmp(self):
        """Reset the testfiles/output directory"""
        output_dir.deltree()
        output_dir.mkdir()

    def set_gpg_profile(self):
        """Set gpg profile to standard "foobar" sym"""
        globals.gpg_profile = gpg.GPGProfile(passphrase = "foobar")

    def test_backup_chains(self):
        """Test basic backup chain construction"""
        random.shuffle(filename_list1)

# 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/gpg.py
# class GPGError(Exception):
# class GPGProfile:
# class GPGFile:
#     class FileCounted:
#     def __init__(self, passphrase = None, sign_key = None,
#                  recipients = None):
#     def __init__(self, encrypt, encrypt_path, profile):
#     def read(self, length = -1):
#     def write(self, buf):
#     def gpg_failed(self):
#     def close(self):
#     def set_signature(self):
#     def get_signature(self):
# def GPGWriteFile(block_iter, filename, profile,
#                  size = 200 * 1024 * 1024,
#                  max_footer_size = 16 * 1024):
#     def top_off(bytes, file):
#     def get_current_size():
# def GzipWriteFile(block_iter, filename,
#                   size = 200 * 1024 * 1024,
#                   max_footer_size = 16 * 1024):
#         def __init__(self, fileobj):
#         def write(self, buf):
#         def close(self):
# def get_hash(hash, path, hex = 1):
# 
# Path: duplicity/globals.py



# Path: testing/collectionstest.py
import config
import os, sys, random, unittest
from duplicity import collections
from duplicity import backend
from duplicity import path
from duplicity import gpg
from duplicity import globals
from duplicity import dup_time

                                           "/archive_dir")

dummy_backend = None
real_backend = backend.get_backend("file://%s/%s" %
                                   (col_test_dir.name, "remote_dir"))
output_dir = path.Path("testfiles/output") # used as a temp directory
output_dir_backend = backend.get_backend("file://testfiles/output")


class CollectionTest(unittest.TestCase):
    """Test collections"""
    def setUp(self):
        assert not os.system("tar xzf testfiles.tar.gz > /dev/null 2>&1")
        assert not os.system("mkdir testfiles/output")

    def tearDown(self):
        assert not os.system("rm -rf testfiles tempdir temp2.tar")

    def del_tmp(self):
        """Reset the testfiles/output directory"""
        output_dir.deltree()
        output_dir.mkdir()

    def set_gpg_profile(self):
        """Set gpg profile to standard "foobar" sym"""
        globals.gpg_profile = gpg.GPGProfile(passphrase = "foobar")

    def test_backup_chains(self):
        """Test basic backup chain construction"""
        random.shuffle(filename_list1)

        cs = collections.CollectionsStatus(dummy_backend, archive_dir)