From 41b1c56fd06fa2a5f270803daddbb7909b3df5ad Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 30 Jun 2022 11:35:29 -0400 Subject: [PATCH] UT: Add reset_to_default() to InMemoryAgentConfigurationRepository --- .../in_memory_agent_configuration_repository.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/tests/monkey_island/in_memory_agent_configuration_repository.py b/monkey/tests/monkey_island/in_memory_agent_configuration_repository.py index e9bcbae62..cf97ac08a 100644 --- a/monkey/tests/monkey_island/in_memory_agent_configuration_repository.py +++ b/monkey/tests/monkey_island/in_memory_agent_configuration_repository.py @@ -6,10 +6,14 @@ from monkey_island.cc.repository import IAgentConfigurationRepository class InMemoryAgentConfigurationRepository(IAgentConfigurationRepository): def __init__(self): - self._configuration = AgentConfiguration.from_mapping(AGENT_CONFIGURATION) + self._default_configuration = AgentConfiguration.from_mapping(AGENT_CONFIGURATION) + self._configuration = self._default_configuration def get_configuration(self): return self._configuration def store_configuration(self, agent_configuration): self._configuration = agent_configuration + + def reset_to_default(self): + self._configuration = self._default_configuration