示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def test_load(self):
   with testctx() as tmpdir:
     ouimgr = OuiMgr(tmpdir)
     self.assertIs(ouimgr.load(),None)