Error hook test.

This commit is contained in:
Dan Helfman 2019-06-13 10:14:16 -07:00
parent 7f126ce127
commit 28cdd67743
2 changed files with 10 additions and 1 deletions

3
NEWS
View File

@ -1,6 +1,7 @@
1.3.6.dev0
* #53: Log to syslog in addition to existing console logging. Add --syslog-verbosity flag to
customize the log level.
customize the log level. See the documentation for more information:
https://torsion.org/borgmatic/docs/how-to/inspect-your-backups/
* #178: Look for .yml configuration file extension in addition to .yaml.
* Remove Python cache files before each Tox run.
* Add #borgmatic Freenode IRC channel to documentation.

View File

@ -32,3 +32,11 @@ def test_execute_hook_with_dry_run_skips_commands():
def test_execute_hook_with_empty_commands_does_not_raise():
module.execute_hook([], 'config.yaml', 'post-backup', dry_run=False)
def test_execute_hook_on_error_logs_as_error():
flexmock(module.execute).should_receive('execute_command').with_args(
[':'], output_log_level=logging.ERROR, shell=True
).once()
module.execute_hook([':'], 'config.yaml', 'on-error', dry_run=False)