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 isSimulated(self): """Reactor time is simulated if the clock doesn't go forward""" now = reactor.getTime() time.sleep(0.1) # Ensure "real time" advances return reactor.getTime() == now # If reactor doesn't, it's simulated
def isSimulated(self): """Reactor time is simulated if the clock doesn't go forward""" now = reactor.getTime() time.sleep(0.1) # Ensure "real time" advances return reactor.getTime()==now # If reactor doesn't, it's simulated