fix tests
Signed-off-by: Soumik Dutta <shalearkane@gmail.com>
This commit is contained in:
parent
98e429594e
commit
044ae7869a
4 changed files with 4 additions and 12 deletions
|
@ -29,9 +29,7 @@ def ping_monitor(hook_config, config_filename, state, monitoring_log_level, dry_
|
||||||
'''
|
'''
|
||||||
if state not in MONITOR_STATE_TO_CRONHUB:
|
if state not in MONITOR_STATE_TO_CRONHUB:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'{}: Ignoring unsupported monitoring {} in Cronhub hook'.format(
|
f'{config_filename}: Ignoring unsupported monitoring {state.name.lower()} in Cronhub hook'
|
||||||
config_filename, state.name.lower()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,7 @@ def ping_monitor(hook_config, config_filename, state, monitoring_log_level, dry_
|
||||||
'''
|
'''
|
||||||
if state not in MONITOR_STATE_TO_CRONITOR:
|
if state not in MONITOR_STATE_TO_CRONITOR:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'{}: Ignoring unsupported monitoring {} in Cronitor hook'.format(
|
f'{config_filename}: Ignoring unsupported monitoring {state.name.lower()} in Cronitor hook'
|
||||||
config_filename, state.name.lower()
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,7 @@ def test_ping_monitor_with_other_error_logs_warning():
|
||||||
|
|
||||||
def test_ping_monitor_with_unsupported_monitoring_state():
|
def test_ping_monitor_with_unsupported_monitoring_state():
|
||||||
hook_config = {'ping_url': 'https://example.com'}
|
hook_config = {'ping_url': 'https://example.com'}
|
||||||
flexmock(module.logger).should_receive("debug").once().with_args(
|
flexmock(module.requests).should_receive('get').never()
|
||||||
'{}: Ignoring unsupported monitoring {} in Cronhub hook'.format("config.yaml", "log")
|
|
||||||
)
|
|
||||||
module.ping_monitor(
|
module.ping_monitor(
|
||||||
hook_config, 'config.yaml', module.monitor.State.LOG, monitoring_log_level=1, dry_run=False,
|
hook_config, 'config.yaml', module.monitor.State.LOG, monitoring_log_level=1, dry_run=False,
|
||||||
)
|
)
|
||||||
|
|
|
@ -91,9 +91,7 @@ def test_ping_monitor_with_other_error_logs_warning():
|
||||||
|
|
||||||
def test_ping_monitor_with_unsupported_monitoring_state():
|
def test_ping_monitor_with_unsupported_monitoring_state():
|
||||||
hook_config = {'ping_url': 'https://example.com'}
|
hook_config = {'ping_url': 'https://example.com'}
|
||||||
flexmock(module.logger).should_receive("debug").once().with_args(
|
flexmock(module.requests).should_receive('get').never()
|
||||||
'{}: Ignoring unsupported monitoring {} in Cronitor hook'.format("config.yaml", "log")
|
|
||||||
)
|
|
||||||
module.ping_monitor(
|
module.ping_monitor(
|
||||||
hook_config, 'config.yaml', module.monitor.State.LOG, monitoring_log_level=1, dry_run=False,
|
hook_config, 'config.yaml', module.monitor.State.LOG, monitoring_log_level=1, dry_run=False,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue