예제 #1
0
 def test_stop(self):
     timer = Timer()
     time.sleep(5)
     timer.stop()
     time.sleep(3)
     timer.start()
     time.sleep(5)
     self.assertEqual(timer.get_counter(),10)
예제 #2
0
 def test_init(self):
     timer = Timer()
     time.sleep(5)
     self.assertEqual(timer.get_counter(),20)
예제 #3
0
 def test_interrupt_with_fischer(self):
     timer = Timer(20, 20)
     timer.start()
     time.sleep(5)
     timer.interrupt()
     self.assertEqual(timer.get_counter(), 15)
예제 #4
0
 def test_stop_with_fischer(self):
     timer = Timer(20, 20)
     timer.start()
     time.sleep(5)
     timer.stop()
     self.assertEqual(timer.get_counter(), 35)