diff options
Diffstat (limited to 'test/python')
| -rw-r--r-- | test/python/test_species_by_name.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/python/test_species_by_name.py b/test/python/test_species_by_name.py index 86f80a3..0b8dac2 100644 --- a/test/python/test_species_by_name.py +++ b/test/python/test_species_by_name.py @@ -46,11 +46,20 @@ class SpeciesByNameTest(ServerTestCase): try: conn.request("GET", "/species/not-a-real-species") response = conn.getresponse() - response.read() + body = response.read() finally: conn.close() self.assertEqual(response.status, 404) + request_id = response.getheader("x-request-id") + error = json.loads(body) + self.assertEqual(error["status"], 404) + self.assertEqual(error["code"], "species_not_found") + self.assertEqual(error["operation_id"], "species_by_name") + self.assertEqual(error["spec_url"], "/openapi.json") + self.assertEqual(error["next"], "/species") + self.assertEqual(error["request_id"], request_id) + if __name__ == "__main__": unittest.main() |
