[Twisted-Python] how to unitest this?
sonium at gmail.com
Fri Nov 4 11:17:08 EST 2005
hi, I just read the introduction about unittesting on diveintopython and
now asked myself how I could write a unittest for the connectionmade
function in the code below taken from the tutorial:
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
self.transport.write("An apple a day keeps the doctor away\r\n")
# Next lines are magic:
factory = Factory()
factory.protocol = QOTD
# 8007 is the port you want to run under.
I know there is twisted.trail, but I haven't found any useful
information about it yet.
Or is mockobjects the thing I am looking for?
More information about the Twisted-Python