Skip to content

Commit 7075126

Browse files
fix: Broken tests
1 parent da33350 commit 7075126

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

tests/test_api.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,11 @@ def test_post_file_route() -> None:
6868
def test_post_file_route_failure() -> None:
6969
response = client.post("/file")
7070
assert response.status_code == 422 # Unprocessable Entity
71-
assert response.json() == {
72-
"detail": [
73-
{
74-
"type": "missing",
75-
"loc": ["body", "file"],
76-
"msg": "Field required",
77-
"input": None,
78-
"url": "https://errors.pydantic.dev/2.5/v/missing",
79-
}
80-
]
81-
}
71+
error_detail = response.json().get("detail", [])
72+
assert error_detail
73+
assert error_detail[0]["loc"] == ["body", "file"]
74+
assert "Field required" in error_detail[0]["msg"]
75+
8276

8377

8478
def test_post_file_route_size_limit() -> None:

0 commit comments

Comments
 (0)