added test for value error
This commit is contained in:
parent
5f3d4f9b03
commit
dab0dfcb32
@ -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(
|
||||
|
@ -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():
|
||||
|
Loading…
x
Reference in New Issue
Block a user