UT: Use `simplify=True` when converting configuration to dict

This commit is contained in:
Shreya Malviya 2022-08-31 00:53:18 +05:30
parent d5ee4c7f27
commit 6460639f91
2 changed files with 4 additions and 4 deletions

View File

@ -207,7 +207,7 @@ def test_exploiter_configuration_schema():
def test_exploitation_configuration():
config = ExploitationConfiguration(**EXPLOITATION_CONFIGURATION)
config_dict = config.dict()
config_dict = config.dict(simplify=True)
assert isinstance(config, ExploitationConfiguration)
assert config_dict == convert_all_lists_to_tuples_in_mapping(EXPLOITATION_CONFIGURATION.copy())
@ -215,7 +215,7 @@ def test_exploitation_configuration():
def test_propagation_configuration():
config = PropagationConfiguration(**PROPAGATION_CONFIGURATION)
config_dict = config.dict()
config_dict = config.dict(simplify=True)
assert isinstance(config, PropagationConfiguration)
assert isinstance(config.network_scan, NetworkScanConfiguration)
@ -234,7 +234,7 @@ def test_propagation_configuration__invalid_maximum_depth():
def test_agent_configuration():
config = AgentConfiguration(**AGENT_CONFIGURATION)
config_dict = config.dict()
config_dict = config.dict(simplify=True)
assert isinstance(config, AgentConfiguration)
assert config.keep_tunnel_open_time == 30

View File

@ -26,7 +26,7 @@ def flask_client(build_flask_client):
def test_agent_configuration_endpoint(flask_client):
resp = flask_client.put(
AGENT_CONFIGURATION_URL,
json=AgentConfiguration(**AGENT_CONFIGURATION).dict(),
json=AgentConfiguration(**AGENT_CONFIGURATION).dict(simplify=True),
follow_redirects=True,
)
assert resp.status_code == 200