> > Be careful. Now you have a test that always succeeds.
>
> No, I'm wrong. Sorry about that: I misread the numerical range.
>
This is the first time I am ever writing unit tests, and I am glad I am
doing it.
Thanks a lot for all your help!.
___
Tuto
On Feb 7, 2016 8:38 AM, "Danny Yoo" wrote:
>
> :
> >
> > def test_red_temperature_simulation(self):
> > """
> > Method to test the red_temperature_simulation method
> > """
> > for i in range(100):
> > test_value = red_temperature_simulation()
>
:
>
> def test_red_temperature_simulation(self):
> """
> Method to test the red_temperature_simulation method
> """
> for i in range(100):
> test_value = red_temperature_simulation()
> self.assertTrue((test_value < 100.0) or (test_valu
> > when my program is in the yellow state, it should generate the numbers
> > from 100.0-100.5
> > and 102.5-103.0
>
> The "and" is a bit misleading as you want to allow values that are in the
> first *or* the second intrval. When you spell that in Python it becomes
>
> temperature = yellow_temper
Anubhav Yadav wrote:
>> Hi Anubhav,
>>
>> Ah! The assert functions are meant to be used as statements, not as
>> composable expressions. If you're familiar with the idea of side
>> effects, then you need to understand that you should be calling the
>> assert functions just for their side effects
> Hi Anubhav,
>
> Ah! The assert functions are meant to be used as statements, not as
> composable expressions. If you're familiar with the idea of side effects,
> then you need to understand that you should be calling the assert functions
> just for their side effects, not for their return value