[Twisted-Python] Re: If lineReceived returns deferred, then connection is dropped and this deferred given as error message

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Tue Oct 31 12:00:32 EST 2006

> And, is it possible to patch it somehow so lineReceived
> function could be unit-tested?

After short reflection I found the solution

def myLineReceived(self, line):
    # ...
    # can return deferred
def lineReceived(self, line):

and unit tests just use myLineReceived. A bit clumsy, but works.

The main question (why lineReceived breaks connection on true 
reply) of course remains valid.

More information about the Twisted-Python mailing list