@@ -99,10 +99,10 @@ def test_pydantic_model() -> None:
9999
100100def test_non_get () -> None :
101101 with TestClient (app ) as client :
102- response = client .put ("/uncached_put " )
102+ response = client .put ("/cached_put " )
103103 assert "X-FastAPI-Cache" not in response .headers
104104 assert response .json () == {"value" : 1 }
105- response = client .put ("/uncached_put " )
105+ response = client .put ("/cached_put " )
106106 assert "X-FastAPI-Cache" not in response .headers
107107 assert response .json () == {"value" : 2 }
108108
@@ -115,25 +115,23 @@ def test_alternate_injected_namespace() -> None:
115115
116116def test_cache_control () -> None :
117117 with TestClient (app ) as client :
118- response = client .put ("/uncached_put" )
119- assert "X-FastAPI-Cache" not in response .headers
118+ response = client .get ("/cached_put" )
120119 assert response .json () == {"value" : 1 }
121120
122121 # HIT
123- response = client .put ("/uncached_put" )
124- assert response .headers .get ("X-FastAPI-Cache" ) == "HIT"
122+ response = client .get ("/cached_put" )
125123 assert response .json () == {"value" : 1 }
126124
127125 # no-cache
128- response = client .put ("/uncached_put " , headers = {"Cache-Control" : "no-cache" })
126+ response = client .get ("/cached_put " , headers = {"Cache-Control" : "no-cache" })
129127 assert response .json () == {"value" : 2 }
130128
131- response = client .put ("/uncached_put " )
129+ response = client .get ("/cached_put " )
132130 assert response .json () == {"value" : 2 }
133131
134132 # no-store
135- response = client .put ("/uncached_put " , headers = {"Cache-Control" : "no-store" })
133+ response = client .get ("/cached_put " , headers = {"Cache-Control" : "no-store" })
136134 assert response .json () == {"value" : 3 }
137135
138- response = client .put ("/uncached_put " )
136+ response = client .get ("/cached_put " )
139137 assert response .json () == {"value" : 2 }
0 commit comments