[Twisted-web] Twisted TDD

Dominic Fox dominic.fox at gmail.com
Mon Jul 5 07:07:21 MDT 2004

Can anyone suggest a good approach for writing unit tests for Twisted
client code?

To give an example, I have my pop3 client code written, and it largely
consists of handle_XXX methods that call other methods in the base
class (pop3.POP3Client), which in turn write data out to the network

One way to test this code would be to implement a transport stub and
have the client connected to that, so we could look at what was
written out when we called handle_XXX. But I think that may be too
low-level. What I really want to know is that when handle_XXX is
called, it calls the appropriate methods on the base class with
appropriate parameters (let the base class implementer worry about
what should then be written out to the network transport).

What's worked for other developers working with Twisted?


// Dream in black and white -
// model cities, shooting up in the air

More information about the Twisted-web mailing list