From 4e0f2c89ec3a5a2690008ed79884427771608ece Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 21 Sep 2022 16:39:24 +0530 Subject: [PATCH] UT: Remove test_island_mode_service.py --- .../cc/services/test_island_mode_service.py | 45 ------------------- 1 file changed, 45 deletions(-) delete mode 100644 monkey/tests/unit_tests/monkey_island/cc/services/test_island_mode_service.py diff --git a/monkey/tests/unit_tests/monkey_island/cc/services/test_island_mode_service.py b/monkey/tests/unit_tests/monkey_island/cc/services/test_island_mode_service.py deleted file mode 100644 index 1d12efb62..000000000 --- a/monkey/tests/unit_tests/monkey_island/cc/services/test_island_mode_service.py +++ /dev/null @@ -1,45 +0,0 @@ -import pytest -from tests.monkey_island import InMemoryAgentConfigurationRepository, InMemorySimulationRepository - -from common.agent_configuration import ( - DEFAULT_AGENT_CONFIGURATION, - DEFAULT_RANSOMWARE_AGENT_CONFIGURATION, -) -from monkey_island.cc.models import IslandMode -from monkey_island.cc.services import IslandModeService - - -@pytest.fixture -def agent_configuration_repository(): - return InMemoryAgentConfigurationRepository() - - -@pytest.fixture -def island_mode_service(agent_configuration_repository): - return IslandModeService( - agent_configuration_repository, - InMemorySimulationRepository(), - DEFAULT_AGENT_CONFIGURATION, - DEFAULT_RANSOMWARE_AGENT_CONFIGURATION, - ) - - -@pytest.mark.parametrize("mode", list(IslandMode)) -def test_set_mode(island_mode_service, mode): - island_mode_service.set_mode(mode) - assert island_mode_service.get_mode() == mode - - -@pytest.mark.parametrize( - "mode, expected_config", - [ - (IslandMode.UNSET, DEFAULT_AGENT_CONFIGURATION), - (IslandMode.ADVANCED, DEFAULT_AGENT_CONFIGURATION), - (IslandMode.RANSOMWARE, DEFAULT_RANSOMWARE_AGENT_CONFIGURATION), - ], -) -def test_set_mode_sets_config( - island_mode_service, agent_configuration_repository, mode, expected_config -): - island_mode_service.set_mode(mode) - assert agent_configuration_repository.get_configuration() == expected_config