Ejemplo n.º 1
0
 def test_halt(self):
     watch = StopWatch()
     watch.halt()
     first = watch.get()
     time.sleep(0.1)
     second = watch.get()
     self.assertEqual(first, second)
Ejemplo n.º 2
0
 def test_get(self):
     watch = StopWatch()
     first = watch.get()
     time.sleep(0.1)
     second = watch.get()
     # *nix tend to overshoot a tiny bit, Windows tend to always be under
     # by max. 1ms
     self.assertAlmostEqual(second - first, 0.1, places=2)
Ejemplo n.º 3
0
 def test_get(self):
     watch = StopWatch()
     first = watch.get()
     time.sleep(0.1)
     second = watch.get()
     # *nix tend to overshoot a tiny bit, Windows tend to always be under
     # by max. 1ms
     self.assertAlmostEqual(second - first, 0.1, places=2)
Ejemplo n.º 4
0
 def test_resume(self):
     watch = StopWatch()
     watch.halt()
     first = watch.get()
     watch.resume()
     time.sleep(0.1)
     second = watch.get()
     # See test_get
     self.assertAlmostEqual(second - first, 0.1, places=2)
Ejemplo n.º 5
0
 def test_resume(self):
     watch = StopWatch()
     watch.halt()
     first = watch.get()
     watch.resume()
     time.sleep(0.1)
     second = watch.get()
     # See test_get
     self.assertAlmostEqual(second - first, 0.1, places=2)
Ejemplo n.º 6
0
 def test_halt(self):
     watch = StopWatch()
     watch.halt()
     first = watch.get()
     time.sleep(0.1)
     second = watch.get()
     self.assertEqual(first, second)
Ejemplo n.º 7
0
 def test_reset(self):
     watch = StopWatch()
     time.sleep(0.1)
     watch.reset()
     self.assertLess(watch.get(), 0.001)
Ejemplo n.º 8
0
 def test_reset(self):
     watch = StopWatch()
     time.sleep(0.1)
     watch.reset()
     self.assertLess(watch.get(), 0.001)