UT: Add InMemoryFileAgentConfigurationRepository

This commit is contained in:
Ilija Lazoroski 2022-06-23 14:29:30 +02:00 committed by Shreya Malviya
parent 891794d927
commit b35832b9dd
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from .single_file_repository import SingleFileRepository from .single_file_repository import SingleFileRepository
from .mock_file_repository import MockFileRepository, FILE_CONTENTS, FILE_NAME from .mock_file_repository import MockFileRepository, FILE_CONTENTS, FILE_NAME
from .open_error_file_repository import OpenErrorFileRepository from .open_error_file_repository import OpenErrorFileRepository
from .in_memory_file_agent_configuration_repository import InMemoryFileAgentConfigurationRepository

View File

@ -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