diff --git a/borgmatic/hooks/pushover.py b/borgmatic/hooks/pushover.py index fa3b2b44..65cc636d 100644 --- a/borgmatic/hooks/pushover.py +++ b/borgmatic/hooks/pushover.py @@ -51,8 +51,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev ) state_config = { - key: (int(value) if key in 'html' else value) - for key, value in state_config.items() + key: (int(value) if key in 'html' else value) for key, value in state_config.items() } data = dict( diff --git a/tests/unit/hooks/test_pushover.py b/tests/unit/hooks/test_pushover.py index da750d76..daa24260 100644 --- a/tests/unit/hooks/test_pushover.py +++ b/tests/unit/hooks/test_pushover.py @@ -1,3 +1,4 @@ +import pytest from flexmock import flexmock import borgmatic.hooks.monitor @@ -237,15 +238,15 @@ def test_ping_monitor_start_state_backup_default_message_with_priority_high_decl flexmock(module.logger).should_receive('warning').never() flexmock(module.requests).should_receive('post').never() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.START, - monitoring_log_level=1, - dry_run=False, - ) + with pytest.raises(ValueError): + module.ping_monitor( + hook_config, + {}, + 'config.yaml', + borgmatic.hooks.monitor.State.START, + monitoring_log_level=1, + dry_run=False, + ) def test_ping_monitor_start_state_backup_based_on_documentation_advanced_example_success():