def _create_archive(number_of_turns): while number_of_turns > 0: backup_thread = borg.BackupThread(['.']) backup_thread.run() number_of_turns -= 1 list_thread = borg.ListThread() return list_thread.run()
def test_prune(repository, create_archive): archive_list = create_archive(2) thread = borg.PruneThread({'hourly': '1'}) thread.run() list_thread = borg.ListThread() repo_archives = list_thread.run() assert len(archive_list) > len(repo_archives)
def _update_archives(self): """Lists all the archive names in the UI.""" thread = borg.ListThread() self.list_archive.clear() archive_names = [] for archive in thread.run(): archive_names.append(archive['name']) self.list_archive.addItems(archive_names)
def test_delete(target_path, archives): archive_list = archives archive_name = archive_list[0]['name'] thread = borg.DeleteThread(archive_name) thread.run() list_thread = borg.ListThread() repo_archives = list_thread.run() assert archive_name not in repo_archives
def archives(repository): backup_thread = borg.BackupThread(['.']) backup_thread.run() list_thread = borg.ListThread() output = list_thread.run() return output