Smart dummy objects

Jp Calderone exarkun at divmod.com
Sun Nov 14 10:40:58 EST 2004


On Sun, 14 Nov 2004 12:30:40 +0000, Jonathan Fine <jfine at pytex.org> wrote:
>I'd appreciate comments on what I'm doing.
> 
> Please be kind, I'm a new kid on the block.
> 
> 
> Here's my application.
> 
> I'm writing some test code.
> 
> (I'm a recent convert to unit testing.)
> 
> 
> I want to test a series of changes to an object.
> 
> The change methods return self, so I can form chains.
> 
> Like so:
>     x = obj.this().that(12).other(x=3, y=12)
>     assert x is obj
> 

  These are often called "mock objects".  See http://pmock.sourceforge.net/

  Jp



More information about the Python-list mailing list