forked from p15670423/monkey
UT: Add InMemoryFileAgentConfigurationRepository
This commit is contained in:
parent
891794d927
commit
b35832b9dd
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue