On Sat, Feb 6, 2016 at 10:07 AM, Anubhav Yadav <[email protected]> wrote:
> class TestCase(unittest.TestCase):
> def test_red_temperature_simulation(self):
> """
> Method to test the red_temperature_simulation method
> """
> for i in range(100000):
> self.assertLess(red_temperature_simulation(), 100.0) and \
> self.assertGreater(red_temperature_simulation(), 103.0)
Is this really what you want (And similarly in your other test
method.)? If I am reading things correctly, you are calling
red_temperature_simulation *twice*, which will *usually* give you two
*separate* values, which you then attempt to compare. Shouldn't you
first do:
for i in range(100000):
value_to_test = red_temperature_simulation()
(self.assertLess(value_to_test, 100.0) <Which logic op?>
self.assertGreater(value_to_test, 103.0))
?
If my understanding is indeed correct, then I will leave it to you to
figure out which logic operator ("and" or "or") makes sense here!
~(:>))
--
boB
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor