Ejemplo n.º 1
0
 def test_wind_chill(self):
     with open(os.path.join(os.getcwd(), 'tests', 'testdata_windchill.csv'), 'rU') as f:
         data = csv.DictReader(f)
         for line in data:
             wind_speed = float(line['windspeed'])
             temperature = float(line['temperature'])
             expected_apparent_temperature = float(line['wind chill'])
             assert Weather.wind_chill(wind_speed, temperature) == expected_apparent_temperature
Ejemplo n.º 2
0
def test_wind_chill(wind, temp):
    assert type(Weather.wind_chill(wind_speed=wind, temperature=temp)) == float
Ejemplo n.º 3
0
def check_heat_index(wind_speed, temperature, expected, places):
    heat_index = Weather.wind_chill(wind_speed, temperature)
    assert round(abs(expected - heat_index), places) == 0