From 8605fd40ac35b3eddfc148d76bce36f8ab342a53 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 24 Jun 2022 11:50:49 -0400 Subject: [PATCH] UT: Add a test for AgentConfiguration.from_dict() --- .../common/configuration/test_agent_configuration.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py b/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py index 7ea80cfc5..13cd106a8 100644 --- a/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py +++ b/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py @@ -1,3 +1,5 @@ +import json + from tests.common.example_agent_configuration import ( AGENT_CONFIGURATION, BLOCKED_IPS, @@ -178,3 +180,12 @@ def test_default_agent_configuration(): config = schema.loads(DEFAULT_AGENT_CONFIGURATION_JSON) assert isinstance(config, AgentConfiguration) + + +def test_from_dict(): + schema = AgentConfigurationSchema() + dict_ = json.loads(DEFAULT_AGENT_CONFIGURATION_JSON) + + config = AgentConfiguration.from_dict(dict_) + + assert schema.dump(config) == dict_