diff --git a/main.py b/main.py index fdf44bbf..f94aa200 100644 --- a/main.py +++ b/main.py @@ -430,7 +430,7 @@ def _send_flow_mods_from_request(self, dpid, command, flows_dict=None): self._install_flows(command, flows_dict, self._get_all_switches_enabled()) - return jsonify({"response": "FlowMod Messages Sent"}) + return jsonify({"response": "FlowMod Messages Sent"}), 202 def _install_flows(self, command, flows_dict, switches=[], save=True): """Execute all procedures to install flows in the switches. diff --git a/tests/unit/test_main.py b/tests/unit/test_main.py index 8f409228..39d1872a 100644 --- a/tests/unit/test_main.py +++ b/tests/unit/test_main.py @@ -108,7 +108,7 @@ def test_rest_add_and_delete_without_dpid(self, mock_install_flows): response_1 = api.post(url, json={'flows': [{"priority": 25}]}) response_2 = api.post(url) - self.assertEqual(response_1.status_code, 200) + self.assertEqual(response_1.status_code, 202) self.assertEqual(response_2.status_code, 400) self.assertEqual(mock_install_flows.call_count, 2) @@ -125,9 +125,9 @@ def test_rest_add_and_delete_with_dpid(self, mock_install_flows): response_1 = api.post(url_1, json=data) response_2 = api.post(url_2, json=data) - self.assertEqual(response_1.status_code, 200) + self.assertEqual(response_1.status_code, 202) if method == 'delete': - self.assertEqual(response_2.status_code, 200) + self.assertEqual(response_2.status_code, 202) self.assertEqual(mock_install_flows.call_count, 3)