def test_temperature_greater_than_10_degrees(self):
     self.assertEqual(5 * 60,
                      filtration_duration.calculate_in_minutes(10.0))
     self.assertEqual(12 * 60,
                      filtration_duration.calculate_in_minutes(24.0))
 def test_temperature_less_than_10_degrees_no_filtration(self):
     self.assertEqual(0, filtration_duration.calculate_in_minutes(9.9))
 def test_temperature_less_than_10_degrees_no_filtration(self):
     self.assertEqual(0, filtration_duration.calculate_in_minutes(9.9))
 def test_temperature_greater_than_10_degrees(self):
     self.assertEqual(5 * 60, filtration_duration.calculate_in_minutes(10.0))
     self.assertEqual(12 * 60, filtration_duration.calculate_in_minutes(24.0))
示例#5
0
def piscine(request):
    values = yield from request.app['current_cost_service'].get_values('pool_temperature', 'temperature')
    last_value = values[-1]['temperature']
    return dict(temperature=last_value, temps_filtrage=str(timedelta(minutes=calculate_in_minutes(last_value))), values=values, **get_default_model(request.app['config']))