From 303d6609e473e2acf6d2c53c7122910f6cf8f6ab Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Mon, 24 Jun 2024 10:27:23 +0100 Subject: [PATCH] removed unecessary tests for 'default urls' as these would never really be used anyway --- tests/unit/hooks/test_uptimekuma.py | 76 ----------------------------- 1 file changed, 76 deletions(-) diff --git a/tests/unit/hooks/test_uptimekuma.py b/tests/unit/hooks/test_uptimekuma.py index 1d57444..2ebdecc 100644 --- a/tests/unit/hooks/test_uptimekuma.py +++ b/tests/unit/hooks/test_uptimekuma.py @@ -37,22 +37,6 @@ def test_ping_monitor_hits_custom_uptimekuma_on_fail(): dry_run=False, ) - -def test_ping_monitor_hits_default_uptimekuma_on_start(): - flexmock(module.requests).should_receive('get').with_args( - f'{DEFAULT_BASE_URL}?status=up&msg=start' - ).and_return(flexmock(ok=True)).once() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.START, - monitoring_log_level=1, - dry_run=False, - ) - - def test_ping_monitor_custom_uptimekuma_on_start(): hook_config = {'push_url': push_url} flexmock(module.requests).should_receive('get').with_args( @@ -68,22 +52,6 @@ def test_ping_monitor_custom_uptimekuma_on_start(): dry_run=False, ) - -def test_ping_monitor_hits_default_uptimekuma_on_finish(): - flexmock(module.requests).should_receive('get').with_args( - f'{DEFAULT_BASE_URL}?status=up&msg=finish' - ).and_return(flexmock(ok=True)).once() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.FINISH, - monitoring_log_level=1, - dry_run=False, - ) - - def test_ping_monitor_custom_uptimekuma_on_finish(): hook_config = {'push_url': CUSTOM_BASE_URL} flexmock(module.requests).should_receive('get').with_args( @@ -99,20 +67,6 @@ def test_ping_monitor_custom_uptimekuma_on_finish(): dry_run=False, ) - -def test_ping_monitor_does_not_hit_default_uptimekuma_on_fail_dry_run(): - flexmock(module.requests).should_receive('get').never() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.FAIL, - monitoring_log_level=1, - dry_run=True, - ) - - def test_ping_monitor_does_not_hit_custom_uptimekuma_on_fail_dry_run(): hook_config = {'push_url': CUSTOM_BASE_URL} flexmock(module.requests).should_receive('get').never() @@ -126,20 +80,6 @@ def test_ping_monitor_does_not_hit_custom_uptimekuma_on_fail_dry_run(): dry_run=True, ) - -def test_ping_monitor_does_not_hit_default_uptimekuma_on_start_dry_run(): - flexmock(module.requests).should_receive('get').never() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.START, - monitoring_log_level=1, - dry_run=True, - ) - - def test_ping_monitor_does_not_hit_custom_uptimekuma_on_start_dry_run(): hook_config = {'push_url': CUSTOM_BASE_URL} flexmock(module.requests).should_receive('get').never() @@ -153,20 +93,6 @@ def test_ping_monitor_does_not_hit_custom_uptimekuma_on_start_dry_run(): dry_run=True, ) - -def test_ping_monitor_does_not_hit_default_uptimekuma_on_finish_dry_run(): - flexmock(module.requests).should_receive('get').never() - - module.ping_monitor( - hook_config, - {}, - 'config.yaml', - borgmatic.hooks.monitor.State.FINISH, - monitoring_log_level=1, - dry_run=True, - ) - - def test_ping_monitor_does_not_hit_custom_uptimekuma_on_finish_dry_run(): hook_config = {'push_url': CUSTOM_BASE_URL} flexmock(module.requests).should_receive('get').never() @@ -196,7 +122,6 @@ def test_ping_monitor_with_connection_error_logs_warning(): dry_run=False, ) - def test_ping_monitor_with_other_error_logs_warning(): response = flexmock(ok=False) response.should_receive('raise_for_status').and_raise( @@ -228,4 +153,3 @@ def test_ping_monitor_with_invalid_run_state(): monitoring_log_level=1, dry_run=True, ) -