From de304f83de4043d6a18b8df09673aa3ff026cc01 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Thu, 16 May 2024 16:06:40 +0200 Subject: [PATCH] Avoid requiring network in test_healthchecks.py Some test environments (e.g., the one of the Nix build system) don't allow network requests while building and testing. --- tests/unit/hooks/test_healthchecks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/unit/hooks/test_healthchecks.py b/tests/unit/hooks/test_healthchecks.py index 1e8a2a1..bef25e1 100644 --- a/tests/unit/hooks/test_healthchecks.py +++ b/tests/unit/hooks/test_healthchecks.py @@ -318,6 +318,9 @@ def test_ping_monitor_does_not_add_create_query_parameter_when_ping_url_is_uuid( def test_ping_monitor_issues_warning_when_ping_url_is_uuid_and_create_slug_true(): hook_config = {'ping_url': 'b3611b24-df9c-4d36-9203-fa292820bf2a', 'create_slug': True} + + flexmock(module.requests).should_receive('post').and_return(flexmock(ok=True)) + flexmock(module.logger).should_receive('warning').once() module.ping_monitor(