Skip to content

Commit

Permalink
Raise ValidationError correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Nov 11, 2024
1 parent 7cc1d5a commit 3aeea90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit_tests/service/test_rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class MyModel(BaseModel):
get_plan_mock.return_value = PlanModel.from_plan(plan)

def raise_validation_error(bar: Any):
return ValidationError.from_exception_data(
raise ValidationError.from_exception_data(
title="ValueError",
line_errors=[
InitErrorDetails(
Expand All @@ -190,7 +190,7 @@ def raise_validation_error(bar: Any):
assert response.status_code == 422
assert response.json() == {
"detail": (
"\n Input validation failed: task_id: Input should be a valid string,\n"
"\n Input validation failed: id: Field required,\n"
" suppplied params {},\n"
" do not match the expected params: {'properties': {'id': "
"{'title': 'Id', 'type': 'string'}}, 'required': ['id'], 'title': "
Expand Down

0 comments on commit 3aeea90

Please sign in to comment.