Ejemplo n.º 1
0
 def testMultipleAddSameTimerPrivate(self):
     """test multiple add() of same timer [private]"""
     task = task_self()
     test_handler = self.__class__.TSimpleTimerChecker()
     timer = EngineTimer(1.0, -1.0, False, test_handler)
     task._engine.add_timer(timer)
     self.assertRaises(EngineIllegalOperationError, task._engine.add_timer,
                       timer)
     task_terminate()
Ejemplo n.º 2
0
 def testRemoveTimerPrivate(self):
     """test engine.remove_timer() [private]"""
     # [private] because engine methods are currently private,
     # users should use timer.invalidate() instead
     task = task_self()
     test_handler = self.__class__.TSimpleTimerChecker()
     timer = EngineTimer(1.0, -1.0, False, test_handler)
     task._engine.add_timer(timer)
     task._engine.remove_timer(timer)
     task_terminate()