示例#1
0
 def test_cancel_already_cancelled(self):
     # Verify that the timer gracefully handles AlreadyCancelled errors.
     self.handle.cancel.side_effect = twisted_error.AlreadyCancelled()
     self.timer.cancel()
     self.handle.cancel.assert_called_once()
示例#2
0
文件: _mock.py 项目: pydron/twistit
 def _check(self):
     if self.called:
         raise error.AlreadyCalled()
     elif self.cancelled:
         raise error.AlreadyCancelled()