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

Method setup_method

tests/test_expires_heuristics.py:136–147  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

134 return time.strftime(TIME_FMT, time.gmtime(self.time_now - period))
135
136 def setup_method(self):
137 self.heuristic = LastModified()
138 self.time_now = time.time()
139 day_in_seconds = 86400
140 self.year_ago = self.last_modified(day_in_seconds * 365)
141 self.week_ago = self.last_modified(day_in_seconds * 7)
142 self.day_ago = self.last_modified(day_in_seconds)
143 self.now = self.last_modified(0)
144
145 # NOTE: We pass in a negative to get a positive... Probably
146 # should refactor.
147 self.day_ahead = self.last_modified(-day_in_seconds)
148
149 def test_no_expiry_is_inferred_when_no_last_modified_is_present(self):
150 assert self.heuristic.update_headers(DummyResponse(200, {})) == {}

Callers

nothing calls this directly

Calls 2

last_modifiedMethod · 0.95
LastModifiedClass · 0.90

Tested by

no test coverage detected