Update `tests/unit/test_protocol_errors.pyto test all search endpoints. Run the tests usingnosetests -vs tests/unit/test_protocol_errors.py``.
Remove the TODO comment, and the check requestClass being in the set of supported methods. (Ignore comment about turning protocol.postMethods into a function).
Add a new test to check each search endpoint for InvalidJson. Sending malformed JSON like "[}" should result in an exceptions.MalformedJsonException.
Add a new test to check that sending a POST request to some suffixes of the valid search URLs will fail with an exceptions.PathNotFoundException (e.g. "/reads/search/xyz" should fail).
Add a new test to send requests in which the mimetype is not "application/json", and verify that these return exceptions.UnsupportedMediaTypeException
Add a new test to check that sending a GET request to the valid POST URLs results in a exceptions.MethodNotAllowedException.
More? There's lots of room to add tests here, as it's a good framework to work in. Go through the code in ga4gh/exceptions.py, ga4gh/frontend.py and ga4gh/backend.py and see what general exceptions can be provoked. Add tests for these here if they haven't already been covered.
Update `tests/unit/test_protocol_errors.py
to test all search endpoints. Run the tests using
nosetests -vs tests/unit/test_protocol_errors.py``.exceptions.MalformedJsonException
.exceptions.PathNotFoundException
(e.g. "/reads/search/xyz" should fail).exceptions.UnsupportedMediaTypeException
ga4gh/exceptions.py
,ga4gh/frontend.py
andga4gh/backend.py
and see what general exceptions can be provoked. Add tests for these here if they haven't already been covered.