2
0

test_prune.py 849 B

1234567891011121314151617181920212223242526
  1. from flexmock import flexmock
  2. from borgmatic.actions import prune as module
  3. def test_run_prune_calls_hooks():
  4. flexmock(module.logger).answer = lambda message: None
  5. flexmock(module.borgmatic.borg.prune).should_receive('prune_archives')
  6. flexmock(module.borgmatic.hooks.command).should_receive('execute_hook').times(2)
  7. prune_arguments = flexmock(stats=flexmock(), list_archives=flexmock())
  8. global_arguments = flexmock(monitoring_verbosity=1, dry_run=False)
  9. module.run_prune(
  10. config_filename='test.yaml',
  11. repository='repo',
  12. storage={},
  13. retention={},
  14. hooks={},
  15. hook_context={},
  16. local_borg_version=None,
  17. prune_arguments=prune_arguments,
  18. global_arguments=global_arguments,
  19. dry_run_label='',
  20. local_path=None,
  21. remote_path=None,
  22. )