def test_heat_index_values_below_80(self): for t_rh, hi in heat_index_below_80.items(): t, rh = t_rh self.assertEqual(round(heat_index(t, rh), 2), hi)
def test_input_temp_class(self): hi = heat_index(Temp(30, unit='c'), 70) self.assertIsInstance(hi, Temp) self.assertEqual(round(hi.c), 35) self.assertEqual(round(hi, 1), 95.1)
def test_heat_index_by_noaa_table(self): for t_rh, hi in heat_index_noaa_table.items(): temp, rel_humidity = t_rh self.assertEqual(round(heat_index(temp, rel_humidity)), hi)
def test_return_type(self): self.assertIsInstance(heat_index(80, 40), Temp) self.assertIsInstance(heat_index(52, 56), Temp)
def test_heat_index_by_noaa_table(self): for t_rh, hi in heat_index_noaa_table.items(): t, rh = t_rh self.assertEqual(round(heat_index(t, rh)), hi)