Hi everyone.
I'm trying to test scheduling with asyncio. I have a function that executes
call_later to run a method later in the future. Basically, what I'm trying
to do is what you do in Twisted with the method callLater of a fictional
Clock, to simulate time passage with the advance method.
class ClientCalculationTestCase(unittest.TestCase):
def setUp(self):
self.tr = proto_helpers.StringTransportWithDisconnection()
self.clock = task.Clock()
self.proto = RemoteCalculationClient()
self.tr.protocol = self.proto
self.proto.callLater = self.clock.callLater
self.proto.makeConnection(self.tr)
def test_timeout(self):
d = self.proto.add(9, 4)
self.assertEqual(self.tr.value(), 'add 9 4\r\n')
self.clock.advance(self.proto.timeOut)
return self.assertFailure(d, ClientTimeoutError)
Is there any way to do this with asyncio?. Thanks for any help provided.
--
https://mail.python.org/mailman/listinfo/python-list