[Twisted-Python] Testing protocols without connection?

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Mon Nov 20 15:20:14 EST 2006


(sorry if it was already described somewhere, but 15 mins of 
googling did not help me)

In one of the recent posts 
(http://twistedmatrix.com/pipermail/twisted-python/2006-November/014374.html)
I noticed the following sentence:

> In general you don't need actual network
> connections to test protocols. For example, there are helpers
> in twisted.test.proto_helpers for mimicking a transport.

How should those be used? Not much docs inside...

To give a simple example, imagine I have some factory which 
provides something over HTTP. And I have test case which setup 
this server on loopback address, connects to it using HTTP, and 
analyses whether correct output was received. Is it possible to 
refactor such test, so it does not create any true TCP 
connection?




More information about the Twisted-Python mailing list