added test for value error

This commit is contained in:
Antonio Fernandez 2024-11-18 07:49:53 -05:00
parent 5f3d4f9b03
commit dab0dfcb32
2 changed files with 11 additions and 11 deletions

View File

@ -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(

View File

@ -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():