Esempio n. 1
0
 def testPopEntry(self):
     """Pop an entry off the queue"""
     cache = ActionCache()
     z = self.ArbitraryAction('x', 'y')
     w= self.ArbitraryAction('x', 'y')
     cache.append(z)
     cache.append(w)
     self.failUnless(cache.pop(w) == z)
     self.failUnless(cache.get(w) == w)
     self.failUnless(cache.pop(z) == w)
     self.failUnless(cache.pop(z) == None)
     self.failIf(cache.contains(w))
Esempio n. 2
0
 def testPutEntry(self):
     """Put an entry in and check for its existance"""
     cache = ActionCache()
     action = BaseAction('x')
     cache.append(action)
     self.failUnless(cache.contains(action))
Esempio n. 3
0
 def testHasEntry(self):
     """Ensure we can tell if an entry exists"""
     cache = ActionCache()
     self.failIf(cache.contains(BaseAction('x')))