From 7f0dfdf5203adc77c118bead9a88a254c8ac8c98 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 14 Jul 2025 12:53:34 +0100 Subject: [PATCH] Rev gateway tests --- tests/unit/test_gateway/test_config_receiver.py | 4 ++-- tests/unit/test_gateway/test_service.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/unit/test_gateway/test_config_receiver.py b/tests/unit/test_gateway/test_config_receiver.py index 04dfc514..bfb5c672 100644 --- a/tests/unit/test_gateway/test_config_receiver.py +++ b/tests/unit/test_gateway/test_config_receiver.py @@ -313,8 +313,8 @@ class TestConfigReceiver: } # Mock the flow methods using patch.object to avoid coroutine creation during assignment - start_flow_mock = AsyncMock() - stop_flow_mock = AsyncMock() + start_flow_mock = Mock() + stop_flow_mock = Mock() with patch.object(config_receiver, 'start_flow', start_flow_mock), \ patch.object(config_receiver, 'stop_flow', stop_flow_mock): diff --git a/tests/unit/test_gateway/test_service.py b/tests/unit/test_gateway/test_service.py index d5730eff..37c00a0f 100644 --- a/tests/unit/test_gateway/test_service.py +++ b/tests/unit/test_gateway/test_service.py @@ -226,8 +226,9 @@ class TestRunFunction: mock_args.metrics_port = 8000 mock_parse_args.return_value = mock_args - # Mock the Api instance + # Mock the Api instance and its run method mock_api_instance = Mock() + mock_api_instance.run = Mock() mock_api.return_value = mock_api_instance # Mock vars() to return a dict @@ -258,8 +259,9 @@ class TestRunFunction: mock_args.metrics = False mock_parse_args.return_value = mock_args - # Mock the Api instance + # Mock the Api instance and its run method mock_api_instance = Mock() + mock_api_instance.run = Mock() mock_api.return_value = mock_api_instance # Mock vars() to return a dict @@ -289,8 +291,9 @@ class TestRunFunction: mock_args.metrics = False mock_parse_args.return_value = mock_args - # Mock the Api instance + # Mock the Api instance and its run method mock_api_instance = Mock() + mock_api_instance.run = Mock() mock_api.return_value = mock_api_instance # Mock vars() to return a dict with all expected arguments