diff --git a/monkey/tests/monkey_island/__init__.py b/monkey/tests/monkey_island/__init__.py index aed4d07f3..8f8ae7404 100644 --- a/monkey/tests/monkey_island/__init__.py +++ b/monkey/tests/monkey_island/__init__.py @@ -1,3 +1,4 @@ from .single_file_repository import SingleFileRepository from .mock_file_repository import MockFileRepository, FILE_CONTENTS, FILE_NAME from .open_error_file_repository import OpenErrorFileRepository +from .in_memory_file_agent_configuration_repository import InMemoryFileAgentConfigurationRepository diff --git a/monkey/tests/monkey_island/in_memory_file_agent_configuration_repository.py b/monkey/tests/monkey_island/in_memory_file_agent_configuration_repository.py new file mode 100644 index 000000000..955e78878 --- /dev/null +++ b/monkey/tests/monkey_island/in_memory_file_agent_configuration_repository.py @@ -0,0 +1,15 @@ +from tests.common.example_agent_configuration import AGENT_CONFIGURATION + +from common.configuration.agent_configuration import AgentConfigurationSchema +from monkey_island.cc.repository import IAgentConfigurationRepository + + +class InMemoryFileAgentConfigurationRepository(IAgentConfigurationRepository): + def __init__(self): + self._configuration = AgentConfigurationSchema().load(AGENT_CONFIGURATION) + + def get_configuration(self): + return self._configuration + + def store_configuration(self, agent_configuration): + self._configuration = agent_configuration