def test_save(self): with testctx() as tmpdir: ouimgr = OuiMgr(tmpdir) cache = Random.cache() ouimgr.save(cache) x = ouimgr.load() smokecache(self,x) self.assertEquals(x,cache)
def test_expire(self): with testctx() as tmpdir: ouimgr = OuiMgr(tmpdir) cache = Random.cache() ouimgr.save(cache) # Let it expire. time.sleep(shortthresh + 1) self.assertIs(ouimgr.load(),None)
def test_load(self): with testctx() as tmpdir: ouimgr = OuiMgr(tmpdir) self.assertIs(ouimgr.load(),None)