UT: Simplify assertion logic in common/agent_configuration/test_agent_configuration.py

This commit is contained in:
Shreya Malviya 2022-08-31 00:57:13 +05:30
parent 6460639f91
commit 9db1a19ad3
1 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,6 @@ from tests.common.example_agent_configuration import (
WINDOWS_COMMAND, WINDOWS_COMMAND,
WINDOWS_FILENAME, WINDOWS_FILENAME,
) )
from tests.utils import convert_all_lists_to_tuples_in_mapping
from common.agent_configuration.agent_configuration import AgentConfiguration from common.agent_configuration.agent_configuration import AgentConfiguration
from common.agent_configuration.agent_sub_configurations import ( from common.agent_configuration.agent_sub_configurations import (
@ -210,7 +209,7 @@ def test_exploitation_configuration():
config_dict = config.dict(simplify=True) config_dict = config.dict(simplify=True)
assert isinstance(config, ExploitationConfiguration) assert isinstance(config, ExploitationConfiguration)
assert config_dict == convert_all_lists_to_tuples_in_mapping(EXPLOITATION_CONFIGURATION.copy()) assert config_dict == EXPLOITATION_CONFIGURATION
def test_propagation_configuration(): def test_propagation_configuration():
@ -221,7 +220,7 @@ def test_propagation_configuration():
assert isinstance(config.network_scan, NetworkScanConfiguration) assert isinstance(config.network_scan, NetworkScanConfiguration)
assert isinstance(config.exploitation, ExploitationConfiguration) assert isinstance(config.exploitation, ExploitationConfiguration)
assert config.maximum_depth == 5 assert config.maximum_depth == 5
assert config_dict == convert_all_lists_to_tuples_in_mapping(PROPAGATION_CONFIGURATION.copy()) assert config_dict == PROPAGATION_CONFIGURATION
def test_propagation_configuration__invalid_maximum_depth(): def test_propagation_configuration__invalid_maximum_depth():
@ -243,7 +242,7 @@ def test_agent_configuration():
assert isinstance(config.credential_collectors[0], PluginConfiguration) assert isinstance(config.credential_collectors[0], PluginConfiguration)
assert isinstance(config.payloads[0], PluginConfiguration) assert isinstance(config.payloads[0], PluginConfiguration)
assert isinstance(config.propagation, PropagationConfiguration) assert isinstance(config.propagation, PropagationConfiguration)
assert config_dict == convert_all_lists_to_tuples_in_mapping(AGENT_CONFIGURATION.copy()) assert config_dict == AGENT_CONFIGURATION
def test_agent_configuration__negative_keep_tunnel_open_time(): def test_agent_configuration__negative_keep_tunnel_open_time():