| 107 | |
| 108 | |
| 109 | class 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 | |
| 128 | def datetime_to_header(dt): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…