Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArturoQuintana opened this issue May 21, 2021 · 0 comments

Comments

@ArturoQuintana
Copy link

ArturoQuintana commented May 21, 2021

@hdiogenes @italovalcy @ajoaoff @rmotitsuki

  • If the payload items field is empty, it returns 200 when it should be 400.

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": [
                {

                }
            ]
        }
  • A not serializable JSON broke the application, and it should return a 400 error.

Case:

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

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

ArturoQuintana added a commit to ArturoQuintana/kytos-end-to-end-tests that referenced this issue May 27, 2021
These tests had the following reports:

"""
The Api call is returning 200 when should be 400
Issue kytos/flow_manager#134
"""
PR (No associated PR appears).

"""
The Api call is returning 200 when should be 400
Issue kytos/flow_manager#132
"""
PR kytos/flow_manager#137 closes this issue

"""
The Api call is returning 200 when should be 400
Issue kytos/flow_manager#136
"""
PR (No associated PR appears).

"""
The Api call is returning 200 when should be 400
Issue kytos/flow_manager#135
"""
PR (No associated PR appears).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant