def testSimulatedTimeFunctions(self): now = reactor.getTime() delay = 15 reactor.sleep(delay) self.assertEqual(reactor.getTime(), now + delay) reactor.setTime(now) # put the clock back self.assertEqual(reactor.getTime(), now)
def testSimulatedTimeFunctions(self): now = reactor.getTime() delay = 15 reactor.sleep(delay) self.assertEqual(reactor.getTime(), now+delay) reactor.setTime(now) # put the clock back self.assertEqual(reactor.getTime(), now)
def testRealTimeIsReal(self): reactor.useRealTime() self.failIf(self.isSimulated()) # shouldn't let us set the time, either self.assertRaises(AssertionError, lambda: reactor.setTime(0))
def testRealTimeIsReal(self): reactor.useRealTime() self.failIf(self.isSimulated()) # shouldn't let us set the time, either self.assertRaises(AssertionError, lambda: reactor.setTime(0))