Re: [Tutor] unittests

2014-04-04 Thread Sydney Shall
On 04/04/2014 14:55, Albert-Jan Roskam wrote: - Original Message - From: Sydney Shall To: tutor@python.org Cc: Sent: Friday, April 4, 2014 3:12 PM Subject: Re: [Tutor] unittests I would like to thank both Steven and Danny for their explanations. They were much easier for me to

Re: [Tutor] unittests

2014-04-04 Thread Albert-Jan Roskam
- Original Message - > From: Sydney Shall > To: tutor@python.org > Cc: > Sent: Friday, April 4, 2014 3:12 PM > Subject: Re: [Tutor] unittests > > I would like to thank both Steven and Danny for their explanations. > They were much easier for me to understand tha

Re: [Tutor] unittests

2014-04-04 Thread Sydney Shall
I would like to thank both Steven and Danny for their explanations. They were much easier for me to understand than the documentation. I now think that I understand what I have to do and how I proceed. Thanks to you both for spending so much time on the answer. Sydney On 01/04/2014 18:54, Danny

Re: [Tutor] unittests

2014-04-01 Thread Danny Yoo
> Yes, that unit test was written by Danny (I assume -- I suppose he might > have copied it from somewhere else.) Oh, who knows where I got that code from. :P --- Sydney, you can also take a look at some of the official documentation of the unittest library: https://docs.python.org/2/libra

Re: [Tutor] unittests

2014-04-01 Thread Steven D'Aprano
On Tue, Apr 01, 2014 at 12:30:46PM +0100, Sydney Shall wrote: > Another debutant! > I am having trouble learning to use unittests. > My question is; > In the example below, did you write the class > "SquareRootTests(unittest.TestCase):" ? Yes, that unit test was written by Danny (I assume --

Re: [Tutor] unittests, testing a type

2009-07-16 Thread Dave Angel
if I don't have a value that is a Decimal object something is wrong. Cheers, T Original-Nachricht Datum: Tue, 14 Jul 2009 22:36:14 -0400 Von: Dave Angel An: CC: Todd Matsumoto , tutor@python.org Betreff: Re: Re: [Tutor] unittests, testing a type On T

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
ve a value that is a Decimal object something is wrong. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 22:36:14 -0400 > Von: Dave Angel > An: > CC: Todd Matsumoto , tutor@python.org > Betreff: Re: Re: [Tutor] unittests, testing a type > On Tue, J

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Dave Angel
On Tue, Jul 14, 2009 at 9:59 AM, Todd Matsumoto wrote: 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? How are you receiving it? File, pickle, pipe, socket, exit() return value? When I first read

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Kent Johnson
On Tue, Jul 14, 2009 at 9:59 AM, Todd Matsumoto 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

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Kent Johnson
On Tue, Jul 14, 2009 at 9:45 AM, A.T.Hofkamp wrote: > Todd Matsumoto wrote: >> >> Hi, >> >> Does anyone know how to do a unittest assert for a type? > For new-style classes, you should be able to do > > > type(result) is Decimal When possible, it's better to use assertEqual() rather than a plain

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
his test-driven development thing. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 15:45:18 +0200 > Von: "A.T.Hofkamp" > An: Todd Matsumoto > CC: "tutor@python.org" > Betreff: Re: [Tutor] unittests, testing a type > Todd Matsumoto

Re: [Tutor] unittests, testing a type

2009-07-14 Thread A.T.Hofkamp
Todd Matsumoto wrote: Hi, Does anyone know how to do a unittest assert for a type? So If you have a program returning a Decimal, lets say Decimal("1"), and you want to make sure that what is returned is a Decimal object. At first I thought of importing Decimal and making my own Decimal("1")