[Twisted-Python] Deferreds and Trial -- getting my timing right

Jean-Paul Calderone exarkun at divmod.com
Wed Oct 31 13:15:39 EDT 2007


On Wed, 31 Oct 2007 12:01:06 -0500, Brendon Colby <brendoncolby at gmail.com> wrote:
>On 10/31/07, Jean-Paul Calderone <exarkun at divmod.com> wrote:
>>
>> When your factory begins listening on its first port.
>>
>>   f = YourFactory()
>>   reactor.listenTCP(0, f) # <- here
>>   reactor.run()
>>
>> Jean-Paul
>
>
>So what do I need to do in my unittests to get this to work? I'm using a
>FileWrapper now to mock this up, so I never run listenTCP() of course.

I dunno.  I can't remember the last time I put any code in a factory's
__init__ or its startFactory method.  Maybe you could call the startFactory
method in your test?

Jean-Paul




More information about the Twisted-Python mailing list