def test_delay(self): # This test checks several delays print '#'*73, '\n', 'test_delay', '\n', '#'*73 for i in [0, 1, 2, 3]: print 'Testing delay:', i config = {'delay': i} t1 = time.time() delay(config=config) t2 = time.time() - t1 self.assertTrue(t2 > i and t2 < i + 1)
def test_delay(self): # This test checks several delays print '#' * 73, '\n', 'test_delay', '\n', '#' * 73 for i in [0, 1, 2, 3]: print 'Testing delay:', i config = {'delay': i} t1 = time.time() delay(config=config) t2 = time.time() - t1 print 'Elapsed time in seconds (approx.):', t2 self.assertTrue(t2 + 0.01 > i and t2 < i + 1)
def test_delay(self): # This test checks several delays print '#'*73, '\n', 'test_delay', '\n', '#'*73 for i in [0, 1, 2, 3]: print 'Testing delay:', i config = {'delay': i} t1 = time.time() delay(config=config) t2 = time.time() - t1 print 'Elapsed time in seconds (approx.):', t2 self.assertTrue(t2 + 0.01 > i and t2 < i + 1)