kytos / flow_manager

MIT License
1 stars 16 forks source link

API call flow_manager/v2/flows/{dpid} on GET is returning misleading response status in case of an unknown path #131

Closed ArturoQuintana closed 3 years ago

ArturoQuintana commented 3 years ago

@hdiogenes @ajoaoff @italovalcy @rmotitsuki

The action to retrieve a flow from an unknown path is returning 500 when it should be 404.

Reflected on the end-to-end test: tests/test_e2e_20_flow_manager.py::TestE2EFlowManager::test_014_retrieve_flow_from_non_existent_path_should_fail

Code:

def test_014_retrieve_flow_from_non_existent_path_should_fail(self):

        switch_id = '00:00:00:00:00:00:00:05'

        # It tries to get a flow that does not exist
        api_url = KYTOS_API + '/flow_manager/v2/flows/' + switch_id
        response = requests.get(api_url)
        assert response.status_code == 404