From 9a880123da49dbd3044bdea220c98424366a9bef Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Thu, 29 Sep 2022 16:26:27 +0000 Subject: [PATCH] UT: Fix failing tests --- .../agent_event_handlers/test_handle_ping_scan_event.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_handle_ping_scan_event.py b/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_handle_ping_scan_event.py index e461b584c..1e2e18789 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_handle_ping_scan_event.py +++ b/monkey/tests/unit_tests/monkey_island/cc/agent_event_handlers/test_handle_ping_scan_event.py @@ -125,7 +125,7 @@ class error_machine_by_ip: return machines -def test_handle_ping_scan_event__upserts_machine( +def test_handle_ping_scan_event__target_machine_not_exists( handler: handle_ping_scan_event, machine_repository: IMachineRepository, ): @@ -133,13 +133,13 @@ def test_handle_ping_scan_event__upserts_machine( machine_repository.get_machines_by_ip = MagicMock(side_effect=UnknownRecordError) handler(EVENT) - expected_machine = TARGET_MACHINE.copy() - expected_machine.operating_system = OperatingSystem.LINUX + expected_machine = Machine(id=SEED_ID, network_interfaces=[IPv4Interface(EVENT.target)]) + expected_machine.operating_system = EVENT.os machine_repository.upsert_machine.assert_called_with(expected_machine) -def test_handle_ping_scan_event__machine_already_exists( +def test_handle_ping_scan_event__target_machine_already_exists( handler: handle_ping_scan_event, machine_repository: IMachineRepository, ):