From cd91b3e42abbfdfe6f49d79f9c254cd8988ea5e4 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 7 Sep 2022 18:12:24 +0530 Subject: [PATCH] UT: Rename RequestsGetArgument -> MockRequestsGetResponsePerServerArgument --- monkey/tests/unit_tests/infection_monkey/test_control.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/tests/unit_tests/infection_monkey/test_control.py b/monkey/tests/unit_tests/infection_monkey/test_control.py index c5b8c0fb9..7131dc5ab 100644 --- a/monkey/tests/unit_tests/infection_monkey/test_control.py +++ b/monkey/tests/unit_tests/infection_monkey/test_control.py @@ -19,7 +19,7 @@ class MockConnectionError: raise requests.exceptions.ConnectionError -class RequestsGetArgument: +class MockRequestsGetResponsePerServerArgument: def __init__(self, *args, **kwargs): if SERVER_1 in args[0]: MockConnectionError() @@ -55,7 +55,9 @@ def test_control_find_server__no_available_relays(monkeypatch, servers): def test_control_find_server__control_message_sent_to_necessary_relays(monkeypatch, servers): mock_connect = MagicMock() mock_send = MagicMock() - monkeypatch.setattr("infection_monkey.control.requests.get", RequestsGetArgument) + monkeypatch.setattr( + "infection_monkey.control.requests.get", MockRequestsGetResponsePerServerArgument + ) monkeypatch.setattr("infection_monkey.control.socket.socket.connect", mock_connect) monkeypatch.setattr("infection_monkey.control.socket.socket.send", mock_send)