Skip to content

Commit

Permalink
Add message test for v2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
monst committed Oct 12, 2023
1 parent 6b0be3c commit 8771195
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/routes/messages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ def test_send_message(test_client, headers, mocker):
"query": "Some query",
},
}
response = test_client.post("/api/v1/messages", headers=headers, json=body)
assert response.status_code == 200
assert response.json() == {
response_v1 = test_client.post("/api/v1/messages", headers=headers, json=body)
assert response_v1.status_code == 200
assert response_v1.json() == {
"usedModel": "GPT35_TURBO",
"message": {
"sentAt": "2023-06-16T01:21:34+00:00",
"content": [{"textContent": "some content", "type": "text"}],
},
}

response_v2 = test_client.post("/api/v2/messages", headers=headers, json=body)
assert response_v2.status_code == 200
assert response_v2.json() == {
"usedModel": "GPT35_TURBO",
"sentAt": "2023-06-16T01:21:34+00:00",
"content": {
Expand Down

0 comments on commit 8771195

Please sign in to comment.