'Test weather attributes.'

def test_attributes(self):

    state = self.hass.states.get('weather.demo_weather_south')
    assert (state is not None)
    assert (state.state == 'sunny')
    data = state.attributes
    assert (data.get(ATTR_WEATHER_TEMPERATURE) == 21)
    assert (data.get(ATTR_WEATHER_HUMIDITY) == 92)
    assert (data.get(ATTR_WEATHER_PRESSURE) == 1099)
    assert (data.get(ATTR_WEATHER_WIND_SPEED) == 0.5)
    assert (data.get(ATTR_WEATHER_WIND_BEARING) is None)
    assert (data.get(ATTR_WEATHER_OZONE) is None)
    assert (data.get(ATTR_WEATHER_ATTRIBUTION) == 'Powered    by    Home    Assistant')
    assert (data.get(ATTR_FORECAST)[0].get(ATTR_FORECAST_TEMP) == 22)
    assert (data.get(ATTR_FORECAST)[6].get(ATTR_FORECAST_TEMP) == 21)
    assert (len(data.get(ATTR_FORECAST)) == 7)
