From 6f8994b843fa3000e3fc048c5069b535fa73980a Mon Sep 17 00:00:00 2001 From: John Lyu Date: Thu, 9 May 2024 14:43:53 +0800 Subject: [PATCH] fix test --- tests/test_decorator.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_decorator.py b/tests/test_decorator.py index f8d2028..af38d7e 100644 --- a/tests/test_decorator.py +++ b/tests/test_decorator.py @@ -115,25 +115,25 @@ def test_alternate_injected_namespace() -> None: def test_cache_control() -> None: with TestClient(app) as client: - response = client.get("/uncached_put") + response = client.put("/uncached_put") assert "X-FastAPI-Cache" not in response.headers assert response.json() == {"value": 1} # HIT - response = client.get("/uncached_put") + response = client.put("/uncached_put") assert response.headers.get("X-FastAPI-Cache") == "HIT" assert response.json() == {"value": 1} # no-cache - response = client.get("/uncached_put", headers={"Cache-Control": "no-cache"}) + response = client.put("/uncached_put", headers={"Cache-Control": "no-cache"}) assert response.json() == {"value": 2} - response = client.get("/uncached_put") + response = client.put("/uncached_put") assert response.json() == {"value": 2} # no-store - response = client.get("/uncached_put", headers={"Cache-Control": "no-store"}) + response = client.put("/uncached_put", headers={"Cache-Control": "no-store"}) assert response.json() == {"value": 3} - response = client.get("/uncached_put") + response = client.put("/uncached_put") assert response.json() == {"value": 2}