コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 def test_return_type(self):
     self.assertIsInstance(heat_index(80, 40), Temp)
     self.assertIsInstance(heat_index(52, 56), Temp)
コード例 #5
0
 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)