Skip to content

Commit

Permalink
Add validation error test.
Browse files Browse the repository at this point in the history
  • Loading branch information
squidarth committed Dec 27, 2023
1 parent 2405321 commit 64d093a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "truss"
version = "0.7.23rc2"
version = "0.7.23rc3"
description = "A seamless bridge from model development to model delivery"
license = "MIT"
readme = "README.md"
Expand Down
8 changes: 8 additions & 0 deletions truss/tests/test_model_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def test_truss_with_annotated_inputs_outputs():
"generated_text": "value",
}

# An invalid input

response = requests.post(full_url, json={"bad_key": "value"})

assert response.status_code == 400
assert "error" in response.json()
assert "validation error" in response.json()["error"]

schema_response = requests.get(f"{truss_server_addr}/v1/models/model/schema")

schema = schema_response.json()
Expand Down

0 comments on commit 64d093a

Please sign in to comment.