[Twisted-Python] Conch Testing server and client

Itamar Turner-Trauring itamar at itamarst.org
Fri Jul 1 09:46:58 EDT 2011


On Fri, 2011-07-01 at 19:11 +0530, Anshul Singhle wrote:

>      def test_1(self):
>          def got_data(data):
>              self.assertEquals(data,"a")
>          d = protocol.ClientCreator(reactor,
> SimpleTransport).connectTCP('localhost', self.server.getHost().port)
>          d.addCallback(got_data)
>          return d

ClientCreator.connectTCP returns a Deferred that fires with a Protocol
instance (in this case, a SimpleTransport instance), which you are then
comparing with a string in got_data(). This fails, as one would expect.




More information about the Twisted-Python mailing list