[Tutor] unittests, testing a type

Kent Johnson kent37 at tds.net
Tue Jul 14 16:58:32 CEST 2009


On Tue, Jul 14, 2009 at 9:59 AM, Todd Matsumoto<tmatsumoto at gmx.net> wrote:
> Okay,
>
> Thanks that worked.
>
> I still needed to import the Decimal class and I'm not sure that is okay.

Sure, why not?

> The reason why is I'm receiving the Decimal value from another program, if I already know that the value will be a Decimal why test it?

Well, why are you testing it? What was the motivation for your
original question?

It's fine to right a test that verifies that the other program is
doing what you expect. That's all any passing test really does, is
verify expected behaviour. The benefit is that if the behaviour ever
changes your test will fail and you will find out.

Kent


More information about the Tutor mailing list