Beispiel #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')
Beispiel #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)
Beispiel #3
0
 def setUp(self):
     self.red = BounceStatus('red')
     self.green = BounceStatus('green')
     self.yellow = BounceStatus('yellow')
Beispiel #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)