From 9d6b0c5a61bf1ba1eef438a9db744d1336813c66 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 22 Jul 2022 12:12:07 -0400 Subject: [PATCH] UT: Use `json=` in calls to `POST /api/agent-configuration` --- .../monkey_island/cc/resources/test_agent_configuration.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_configuration.py b/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_configuration.py index 43d403eed..917aaf562 100644 --- a/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_configuration.py +++ b/monkey/tests/unit_tests/monkey_island/cc/resources/test_agent_configuration.py @@ -28,7 +28,7 @@ def flask_client(build_flask_client): def test_agent_configuration_endpoint(flask_client): resp = flask_client.post( AGENT_CONFIGURATION_URL, - data=AgentConfiguration.to_json(AGENT_CONFIGURATION), + json=AgentConfiguration.to_mapping(AGENT_CONFIGURATION), follow_redirects=True, ) assert resp.status_code == 200 @@ -39,9 +39,7 @@ def test_agent_configuration_endpoint(flask_client): def test_agent_configuration_invalid_config(flask_client): - resp = flask_client.post( - AGENT_CONFIGURATION_URL, data=json.dumps({"invalid_config": "invalid_stuff"}) - ) + resp = flask_client.post(AGENT_CONFIGURATION_URL, json={"invalid_config": "invalid_stuff"}) assert resp.status_code == 400