From 281100901987b8b431b3fb6cb9c50ecd9256af87 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 30 Sep 2022 13:10:57 -0400 Subject: [PATCH] UT: Deparametrize a test TCP scan events do not contain OS information. --- .../cc/agent_event_handlers/test_scan_event_handler.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_scan_event_handler.py b/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_scan_event_handler.py index b716ca32f..c2325ed45 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_scan_event_handler.py +++ b/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_scan_event_handler.py @@ -262,19 +262,14 @@ def test_machine_not_upserted(event, handler, machine_repository: IMachineReposi assert not machine_repository.upsert_machine.called -@pytest.mark.parametrize( - "event,handler", - [(PING_SCAN_EVENT, HANDLE_PING_SCAN_METHOD), (TCP_SCAN_EVENT, HANDLE_TCP_SCAN_METHOD)], - indirect=["handler"], -) def test_machine_not_upserted_if_existing_machine_has_os( - event, handler, machine_repository: IMachineRepository, request + scan_event_handler, machine_repository: IMachineRepository, request ): machine_with_os = TARGET_MACHINE machine_with_os.operating_system = OperatingSystem.WINDOWS machine_repository.get_machine_by_ip = MagicMock(return_value=machine_with_os) - handler(event) + scan_event_handler.handle_ping_scan_event(PING_SCAN_EVENT) assert not machine_repository.upsert_machine.called