Art of Unit Testing: Part 2

John Roth johnroth at ameritech.net
Mon Aug 27 04:43:02 CEST 2001


"Ng Pheng Siong" <ngps at madcap.dyndns.org> wrote in message
news:9m8hg4$o9c$1 at dahlia.singnet.com.sg...
> According to John Roth <johnroth at ameritech.net>:
> > "Jesse F. W" <jessefw at loop.com> wrote in message
> > news:mailman.998679338.16044.python-list at python.org...
> > > Should you simulate the parts of the app object that are needed?
>
> > If your class needs a player object for it to make sense, then you need
> > to supply such an object, properly updated.
>
> Not always. You might be able to fake it with "mock objects":
>
>   http://mail.python.org/pipermail/python-list/2001-March/035546.html

As long as it looks like a duck, walks like a duck, and quacks like a duck
it's a duck. It really doesn't matter whether it's the production class or a
testing simulation thereof, except that using the production version is
likely
to inspire greater confidence in the integrity of the testing effort.

John Roth
>
>
> --
> Ng Pheng Siong <ngps at post1.com> * http://www.post1.com/home/ngps
>
> Quidquid latine dictum sit, altum viditur.





More information about the Python-list mailing list