Skip to content

Commit

Permalink
fix pydantic test
Browse files Browse the repository at this point in the history
  • Loading branch information
bentsku committed Oct 11, 2024
1 parent a6af8ec commit 85f01c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from rolo.routing import handler as routing_handler
from rolo.routing import handler_dispatcher

pydantic_version = pydantic.version.version_short()


class MyItem(pydantic.BaseModel):
name: str
Expand Down Expand Up @@ -67,7 +69,7 @@ def handler(_request: Request, item_id: int, item: MyItem) -> dict:
"msg": "Invalid JSON: EOF while parsing a value at line 1 column 0",
"ctx": {"error": "EOF while parsing a value at line 1 column 0"},
"input": "",
"url": "https://errors.pydantic.dev/2.8/v/json_invalid",
"url": f"https://errors.pydantic.dev/{pydantic_version}/v/json_invalid",
}
]

Expand Down Expand Up @@ -126,7 +128,7 @@ def handler(_request: Request, item_id: int, item: MyItem) -> str:
"loc": ["price"],
"msg": "Field required",
"input": {"name": "rolo"},
"url": "https://errors.pydantic.dev/2.8/v/missing",
"url": f"https://errors.pydantic.dev/{pydantic_version}/v/missing",
}
]

Expand Down

0 comments on commit 85f01c2

Please sign in to comment.