Exemplo n.º 1
0
 def test_cancel_already_called(self):
     # Verify that the timer gracefully handles AlreadyCalled errors.
     self.handle.cancel.side_effect = twisted_error.AlreadyCalled()
     self.timer.cancel()
     self.handle.cancel.assert_called_once()
Exemplo n.º 2
0
 def _check(self):
     if self.called:
         raise error.AlreadyCalled()
     elif self.cancelled:
         raise error.AlreadyCancelled()