kytos / flow_manager

MIT License
1 stars 16 forks source link

API call /flow_manager/v2/flows on DELETE is returning misleading response status #135

Open ArturoQuintana opened 3 years ago

ArturoQuintana commented 3 years ago

@hdiogenes @italovalcy @ajoaoff @rmotitsuki

Code:

def test_026_delete_flows_should_fail(self):
        """Test if the flow deletion process specifying an empty payload behaves as expected (400 Error)."""

        payload = {}

        # delete the flow
        api_url = KYTOS_API + '/flow_manager/v2/flows'
        response = requests.delete(api_url, data=json.dumps(payload),
                                   headers={'Content-type': 'application/json'})
        assert response.status_code == 400

The same happens with these cases:

payload = {
            "flows": [
            ]
        }

and

payload = {
            "flows": [
                {

                }
            ]
        }

Case:

payload = {
            "flows": [
                {
                    "priority"
                }
            ]
        }

The issue mentioned above should be verified for any not serializable JSON