UT: Simplify assertion logic in test_agent_configuration_endpoint
This commit is contained in:
parent
5b1558ce53
commit
f7f0047868
|
@ -5,7 +5,6 @@ from tests.common import StubDIContainer
|
||||||
from tests.common.example_agent_configuration import AGENT_CONFIGURATION
|
from tests.common.example_agent_configuration import AGENT_CONFIGURATION
|
||||||
from tests.monkey_island import InMemoryAgentConfigurationRepository
|
from tests.monkey_island import InMemoryAgentConfigurationRepository
|
||||||
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
from tests.unit_tests.monkey_island.conftest import get_url_for_resource
|
||||||
from tests.utils import convert_all_lists_to_tuples_in_mapping
|
|
||||||
|
|
||||||
from common.agent_configuration import AgentConfiguration
|
from common.agent_configuration import AgentConfiguration
|
||||||
from monkey_island.cc.repository import IAgentConfigurationRepository
|
from monkey_island.cc.repository import IAgentConfigurationRepository
|
||||||
|
@ -35,9 +34,7 @@ def test_agent_configuration_endpoint(flask_client):
|
||||||
|
|
||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
|
|
||||||
assert convert_all_lists_to_tuples_in_mapping(
|
assert AgentConfiguration(**json.loads(resp.data)) == AgentConfiguration(**AGENT_CONFIGURATION)
|
||||||
json.loads(resp.data)
|
|
||||||
) == convert_all_lists_to_tuples_in_mapping(AGENT_CONFIGURATION.copy())
|
|
||||||
|
|
||||||
|
|
||||||
def test_agent_configuration_invalid_config(flask_client):
|
def test_agent_configuration_invalid_config(flask_client):
|
||||||
|
|
Loading…
Reference in New Issue