From 429a3dc546aeaf351e065fab06cc2d531ab2807c Mon Sep 17 00:00:00 2001 From: Herrtian <70463940+Herrtian@users.noreply.github.com> Date: Fri, 22 May 2026 13:06:12 +0200 Subject: [PATCH] test: cover auto head route handlers --- tests/test_auto_head_for_get.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_auto_head_for_get.py b/tests/test_auto_head_for_get.py index f16c3526e3..5eb1a3b721 100644 --- a/tests/test_auto_head_for_get.py +++ b/tests/test_auto_head_for_get.py @@ -53,6 +53,9 @@ def test_head_not_in_openapi_schema(): return {"item_id": item_id} client = TestClient(app) + assert client.get("/").json() == {"hello": "world"} + assert client.get("/items/42").json() == {"item_id": 42} + schema = client.get("/openapi.json").json() # HEAD should NOT appear in OpenAPI paths assert list(schema["paths"]["/"].keys()) == ["get"] @@ -71,6 +74,8 @@ def test_head_not_added_to_non_get_routes(): return {"item_id": item_id} client = TestClient(app) + assert client.post("/submit").json() == {"ok": True} + assert client.put("/items/1").json() == {"item_id": 1} assert client.head("/submit").status_code == 405 assert client.head("/items/1").status_code == 405