[Twisted-Python] Avoiding network when testing Perspective Broker
Glyph
glyph at twistedmatrix.com
Fri Oct 26 14:18:43 MDT 2012
On Oct 26, 2012, at 7:16 AM, Itamar Turner-Trauring <itamar at futurefoundries.com> wrote:
>
>
> On Thu, Oct 25, 2012 at 6:32 PM, Glyph <glyph at twistedmatrix.com> wrote:
>
> There are three (count them, three!) classes called "IOPump" in various Twisted test-support modules. Please note that unlike the stuff in proto_helpers these are not supported and will likely go away in a future version of Twisted. However, they do provide a simple demonstration of how to hook up a client and server (calling dataReceived() with what transport.write() produced).
>
> If you'd like to help Twisted itself, we could really use a patch that cleans up all three of those implementations of IOPump, tests them, documents them, and exposes them in a way that would be beneficial to those writing tests like yours.
>
> I guess none of the loopback implementations in twisted.protocols.loopback use StringTransport?
Nope, it has two other transport implementations - _LoopbackTransport and LoopbackRelay; plus, unlike what IOPump does, loopback is written to encourage you to return a Deferred from your test, which is generally a bad idea if you can easily avoid it.
-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20121026/0944fb6c/attachment.html>
More information about the Twisted-Python
mailing list