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)
def test_init(self): timer = Timer() time.sleep(5) self.assertEqual(timer.get_counter(),20)
def test_interrupt_with_fischer(self): timer = Timer(20, 20) timer.start() time.sleep(5) timer.interrupt() self.assertEqual(timer.get_counter(), 15)
def test_stop_with_fischer(self): timer = Timer(20, 20) timer.start() time.sleep(5) timer.stop() self.assertEqual(timer.get_counter(), 35)