Beispiel #1
0
    def test_decay(self):
        tvc = TimedCache(self.cache_secs)
        tvc.put(self.key, self.value)
        time.sleep(self.cache_secs + .1)

        self.assertIsNone(tvc.get(self.key))
Beispiel #2
0
    def test_retrieve(self):
        tvc = TimedCache(self.cache_secs)
        tvc.put(self.key, self.value)

        self.assertTrue(tvc.get(self.key), self.value)