test_prune.py 762 B

12345678910111213141516171819202122
  1. from flexmock import flexmock
  2. from borgmatic.actions import prune as module
  3. def test_run_prune_calls_hooks_for_configured_repository():
  4. flexmock(module.logger).answer = lambda message: None
  5. flexmock(module.borgmatic.borg.prune).should_receive('prune_archives').once()
  6. prune_arguments = flexmock(repository=None, statistics=flexmock(), list_details=flexmock())
  7. global_arguments = flexmock(monitoring_verbosity=1, dry_run=False)
  8. module.run_prune(
  9. config_filename='test.yaml',
  10. repository={'path': 'repo'},
  11. config={},
  12. local_borg_version=None,
  13. prune_arguments=prune_arguments,
  14. global_arguments=global_arguments,
  15. dry_run_label='',
  16. local_path=None,
  17. remote_path=None,
  18. )