Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
def archives(repository):
    backup_thread = borg.BackupThread(['.'])
    backup_thread.run()
    list_thread = borg.ListThread()
    output = list_thread.run()
    return output