Skip to content

Commit

Permalink
Add test for empty RequestBody to suggest request
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Apr 12, 2024
1 parent 2f7aaa5 commit ab33375
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ def test_openapi_suggest_novocab(app_client):
assert req.status_code == 503


def test_openapi_suggest_emptybody(app_client):
data = {}
req = app_client.post(
"http://localhost:8000/v1/projects/dummy-fi/suggest", data=data
)
assert req.status_code == 400
assert req.json()["detail"] == "RequestBody is required"


def test_openapi_suggest_batch(app_client):
data = {"documents": [{"text": "A quick brown fox jumped over the lazy dog."}] * 32}
req = app_client.post(
Expand Down

0 comments on commit ab33375

Please sign in to comment.