Skip to content

Commit

Permalink
add test for new endpoint - insure raise error
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Oct 19, 2023
1 parent f3c45fc commit a23abe9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/test_models_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from unittest import skip
from pprint import pprint
from fastapi.testclient import TestClient
from requests import HTTPError

from app.main import app

Expand Down Expand Up @@ -131,6 +132,10 @@ def test_get_model_details_by_model_id_json(self):
self.assertGreater(len(response.json().get("individuals")), 0)
self.assertGreater(len(response.json().get("facts")), 0)

def test_get_model_details_by_model_id_json_failure(self):
with self.assertRaises(HTTPError):
test_client.get("/api/go-cam/notatallrelevant")


if __name__ == "__main__":
unittest.main()

0 comments on commit a23abe9

Please sign in to comment.