Exemplo n.º 1
0
 def allowable(self, action, when=None):
     """
     Ok to perform the specified action? Returns a boolean value. False
     means a bounce window conflict. For now 'load-acl' is the only valid
     action and moratorium status is not checked.
     """
     assert action == 'load-acl'
     return self.bounce.status(when) == BounceStatus('green')
Exemplo n.º 2
0
 def testComparison(self):
     """Test comparison of BounceStatus against BounceStatus."""
     self.assert_(self.red > self.yellow > self.green)
     self.assert_(self.red == self.red == BounceStatus('red'))
     self.assertNotEquals(self.red, self.yellow)
Exemplo n.º 3
0
 def setUp(self):
     self.red = BounceStatus('red')
     self.green = BounceStatus('green')
     self.yellow = BounceStatus('yellow')
Exemplo n.º 4
0
 def next_ok(self, action, when=None):
     """Return the next time at or after the specified time (default now)
     that it will be ok to perform the specified action."""
     assert action == 'load-acl'
     return self.bounce.next_ok(BounceStatus('green'), when)