diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py index 1386bb6c7..0b9403362 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_island_mode.py @@ -18,12 +18,10 @@ def flask_client(build_flask_client): in_memory_simulation_repository = InMemorySimulationRepository() container.register_instance(ISimulationRepository, in_memory_simulation_repository) - def wrap_in_memory_simulation_repository_set_mode(topic, event): - mode = event - in_memory_simulation_repository.set_mode(mode) - mock_island_event_queue = MagicMock(spec=IIslandEventQueue) - mock_island_event_queue.publish.side_effect = wrap_in_memory_simulation_repository_set_mode + mock_island_event_queue.publish.side_effect = ( + lambda topic, mode: in_memory_simulation_repository.set_mode(mode) + ) container.register_instance(IIslandEventQueue, mock_island_event_queue) with build_flask_client(container) as flask_client: