[Twisted-Python] Mimicking a blocking API using Twisted

Laurens Van Houtven _ at lvh.cc
Sun Mar 25 17:54:50 MDT 2012


The thing I'm documenting is a server, I'm documenting it by interacting with it as a client. I realize that doesn't entirely detract from your point -- you might still be introducing problems that would not affect a "real" client.

My intention is to write BDD-ish stuff (except not with the usual cucumber-style scenario text).

cheers
lvh


On 25 Mar 2012, at 23:44, Itamar Turner-Trauring wrote:

> On 03/25/2012 05:02 PM, Laurens Van Houtven wrote:
>> Hi,
>> 
>> 
>> I'm trying to find out if there's a reasonable way to mimic a blocking 
>> API with an existing non-blocking API. I want to do this so I can 
>> write doctests.
>> 
>> For example, I want to make a remote AMP call. It returns a deferred. 
>> Instead of returning a deferred, I want it to block until the deferred 
>> fires.
> Doctests are supposed to document and test, or perhaps have tested 
> documentation. If the API you're presenting doesn't match actual usage, 
> that's bad documentation...
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list