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_ensure_nonetwork(self): with testctx() as tmpdir: ouimgr = OuiMgr(tmpdir) cache = Random.cache() ouimgr.save(cache) ouimgr = OuiMgr(tmpdir) ouimgr.ensure() smokecache(self,ouimgr.cache)
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_choose_nonetwork(self): with testctx() as tmpdir: ouimgr = OuiMgr(tmpdir) cache = Random.cache() ouimgr.save(cache) smokechoice(self,ouimgr.choose())