Lines Matching +full:no +full:- +full:stale
12 # Test that can do a GET with cache and 'only-if-cached'
17 uri, "GET", headers={"cache-control": "only-if-cached"}
24 # Test that can do a GET with no cache with 'only-if-cached'
28 uri, "GET", headers={"cache-control": "only-if-cached"}
35 # Test that can do a GET with no cache with 'only-if-cached'
37 # that responds to the 'only-if-cached', so this
42 uri, "GET", headers={"cache-control": "only-if-cached"}
51 # when there is no vary, a different Accept header (e.g.) should not
54 # uri = urllib.parse.urljoin(base, "vary/no-vary.asis")
70 # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html.
73 headers={"vary": "Accept", "cache-control": "max-age=300"}, add_date=True
91 # get the resource again, without any Accept header, so again no match
100 headers={"vary": "Accept, Accept-Language", "cache-control": "max-age=300"},
109 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
121 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
131 response, content = http.request(uri, "GET", headers={"Accept-Language": "da"})
139 headers={"vary": "X-No-Such-Header", "cache-control": "max-age=300"},
154 # Test Cache-Control: no-cache on requests
159 headers={"cache-control": "max-age=300"},
162 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
166 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
172 headers={"accept-encoding": "identity", "Cache-Control": "no-cache"},
179 # Test Pragma: no-cache on requests
184 headers={"cache-control": "max-age=300"},
187 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
189 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
193 uri, "GET", headers={"accept-encoding": "identity", "Pragma": "no-cache"}
200 # A no-store request means that the response should not be stored.
205 headers={"cache-control": "max-age=300"},
208 response, _ = http.request(uri, "GET", headers={"Cache-Control": "no-store"})
211 response, _ = http.request(uri, "GET", headers={"Cache-Control": "no-store"})
217 # A no-store response means that the response should not be stored.
222 headers={"cache-control": "max-age=300, no-store"},
234 # Test that a no-store, no-cache clears the entry from the cache
240 headers={"cache-control": "max-age=300"},
247 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
252 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
267 add_date=True, add_etag=True, headers={"cache-control": "max-age=300"}
284 if request.headers.get("if-none-match", "") == "12345":
287 add_date=True, headers={"etag": "12345", "cache-control": "max-age=300"}
290 if request.headers.get("if-match", "") == "12345":
339 uri, "PUT", body=b"foo", headers={"if-match": "fred"}
348 ({"cache-control": " no-cache"}, {"no-cache": 1}),
350 {"cache-control": " no-store, max-age = 7200"},
351 {"no-store": 1, "max-age": "7200"},
353 ({"cache-control": " , "}, {"": 1}), # FIXME
355 {"cache-control": "Max-age=3600;post-check=1800,pre-check=3600"},
356 {"max-age": "3600;post-check=1800", "pre-check": "3600"},
368 h = httplib2._normalize_headers({"Cache-Control": "no-cache", "Other": "Stuff"})
369 assert "cache-control" in h
378 {"cache-control": "no-cache"},
379 {"cache-control": "max-age=7200"},
382 ({}, {"cache-control": "max-age=fred, min-fresh=barney"}, "STALE"),
386 {"date": "{now}", "expires": "{now+3}", "cache-control": "no-cache"},
387 "STALE",
389 ({"cache-control": "must-revalidate"}, {}, "STALE"),
390 ({}, {"cache-control": "must-revalidate"}, "STALE"),
391 ({}, {"date": "{now}", "cache-control": "max-age=0"}, "STALE"),
392 ({"cache-control": "only-if-cached"}, {}, "FRESH"),
393 ({}, {"date": "{now}", "expires": "0"}, "STALE"),
394 ({}, {"data": "{now+3}"}, "STALE"),
396 {"cache-control": "max-age=0"},
397 {"date": "{now}", "cache-control": "max-age=2"},
398 "STALE",
401 {"cache-control": "min-fresh=2"},
403 "STALE",
406 {"cache-control": "min-fresh=2"},
415 nowre = re.compile(r"{now([\+\-]\d+)?}")
433 "cache-control": "max-age=2",
438 assert httplib2._entry_disposition(response_headers, {}) == "STALE"
449 assert httplib2._entry_disposition(response_headers, {}) == "STALE"