| 68 | |
| 69 | |
| 70 | class TestOneDayCache: |
| 71 | def setup_method(self): |
| 72 | self.sess = Session() |
| 73 | self.cached_sess = CacheControl(self.sess, heuristic=OneDayCache()) |
| 74 | |
| 75 | def test_cache_for_one_day(self, url): |
| 76 | the_url = url + "optional_cacheable_request" |
| 77 | r = self.sess.get(the_url) |
| 78 | |
| 79 | assert "expires" in r.headers |
| 80 | assert "warning" in r.headers |
| 81 | |
| 82 | pprint(dict(r.headers)) |
| 83 | |
| 84 | r = self.sess.get(the_url) |
| 85 | pprint(dict(r.headers)) |
| 86 | assert r.from_cache |
| 87 | |
| 88 | |
| 89 | class TestExpiresAfter: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…