MCPcopy Create free account
hub / github.com/psf/cachecontrol / TestLastModified

Class TestLastModified

tests/test_expires_heuristics.py:109–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108
109class TestLastModified:
110 def setup_method(self):
111 self.sess = Session()
112 self.cached_sess = CacheControl(self.sess, heuristic=LastModified())
113
114 def test_last_modified(self, url):
115 the_url = url + "optional_cacheable_request"
116 r = self.sess.get(the_url)
117
118 assert "expires" in r.headers
119 assert "warning" not in r.headers
120
121 pprint(dict(r.headers))
122
123 r = self.sess.get(the_url)
124 pprint(dict(r.headers))
125 assert r.from_cache
126
127
128def datetime_to_header(dt):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…