Пример #1
0
 def test_out_in2(self):
     ''' tests pour_out supplying into_jug, checking temperature'''
     j = Jug(123)
     j2 = Jug(20)
     j.pour_in(100, 56)
     j.pour_out(10, into_jug=j2)
     self.assertAlmostEqual(j2.temperature(), 56)
Пример #2
0
 def test_out_in(self):
     ''' tests pour_out supplying into_jug, checking volume'''
     j = Jug(123)
     j2 = Jug(20)
     j.pour_in(100, 56)
     j.pour_out(10, into_jug=j2)
     self.assertAlmostEqual(j2.water_volume(), 10)
Пример #3
0
 def test_out_in4(self):
     j = Jug(100)
     j.pour_in(100, 0)
     j.pour_in(100, 50)
     print(j.temperature())
Пример #4
0
 def test_allout2(self):
     ''' tests pour_out stipulating more than is inside'''
     j = Jug(123)
     j.pour_in(100, 56)
     j.pour_out(200)
     self.assertAlmostEqual(j.water_volume(), 0)
Пример #5
0
 def test_allout(self):
     ''' tests pour_out with 'all' '''
     j = Jug(123)
     j.pour_in(100, 56)
     j.pour_out('all')
     self.assertAlmostEqual(j.water_volume(), 0)
Пример #6
0
 def test_out(self):
     ''' tests pour_out without supplying into_jug'''
     j = Jug(123)
     j.pour_in(100, 56)
     j.pour_out(6)
     self.assertAlmostEqual(j.water_volume(), 94)
Пример #7
0
 def test_over(self):
     ''' tests pour_in overflow'''
     j = Jug(123)
     j.pour_in(249, 56)
     self.assertAlmostEqual(j.water_volume(), 123)
Пример #8
0
 def test_wv(self):
     ''' tests pour_in water_volume()'''
     j = Jug(123)
     j.pour_in(32, 56)
     self.assertAlmostEqual(j.water_volume(), 32)
Пример #9
0
 def test_temp(self):
     ''' tests pour_in temperature()'''
     j = Jug(123)
     j.pour_in(32, 56)
     self.assertAlmostEqual(j.temperature(), 56)