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
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)
def __init__(self, tmpdir, backup_dir): self.temp_directory = Directory(tmpdir) self.backup_directory = backup_dir self.hidden = False
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)
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
def __init__(self, tmpdir): self.max_archive_size = 8388608 self.temp_directory = Directory(str(tmpdir)) self.encrypted = '' self.compression_method = 'gz'