On Tue, Feb 16, 2010 at 10:03 PM, Jeroen Vermeulen <[email protected]> wrote:

> A FakeMethod can take the place of any function or method, and:
>
>  - Return a constant value.
>  - Raise an exception instead.
>  - Tell you how many times it's been invoked.

> respectively.  It saves time writing tests, but also lets your test get to
> parts it couldn't normally reach because you can mock up so many things so
> quickly.  Plus you can unit-test more classes in fast tests using fewer
> layers, with all the complex work ripped out and exercised only in
> integration tests.
>
> An ancestor of this class allowed me to write unit tests for our failing EC2
> scripts a few months back, and this time I hit a second big use-case with
> the buildfarm work.  Hope you enjoy it as I do!

How does this compare to Gustavo's mocker library (already available
thanks to buildout).


-- 
Stuart Bishop <[email protected]>
http://www.stuartbishop.net/

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to