示例#1
0
 def __init__(self, tmpdir):
     self.vault_name = 'vault_name'
     self.max_archive_size = 8388608
     self.temp_directory = Directory(str(tmpdir))
     self.encrypted = ''
     self.compression_method = 'gz'
     self.upload_retry_time = 0
示例#2
0
 def test_bad_write_permissions(self, tmpdir):
     test_dir = os.path.join(tmpdir, 'dirname/')
     os.mkdir(test_dir)
     os.chmod(test_dir, 0o400)
     with pytest.raises(DirectoryException) as excinfo:
         Directory(test_dir, writable=True)
     assert 'Cannot write' in str(excinfo.value)
示例#3
0
 def __init__(self, tmpdir, backup_dir):
     self.temp_directory = Directory(tmpdir)
     self.backup_directory = backup_dir
     self.hidden = False
示例#4
0
 def test_non_existant(self, tmpdir):
     with pytest.raises(DirectoryException) as excinfo:
         Directory(os.path.join(tmpdir, 'non-existant-directory'))
     assert 'Cannot open' in str(excinfo.value)
示例#5
0
 def test_good_write_directory(self, tmpdir):
     dir_path = os.path.join(tmpdir, 'dirname')
     os.mkdir(dir_path)
     os.chmod(dir_path, 0o700)
     test_dir = Directory(dir_path, writable=True)
     assert dir_path in test_dir.path
示例#6
0
 def __init__(self, tmpdir):
     self.max_archive_size = 8388608
     self.temp_directory = Directory(str(tmpdir))
     self.encrypted = ''
     self.compression_method = 'gz'