def test_air_quality_sensor_with_very_abnormal_reading(self):
    'Test air quality sensor.'
    device = mock_device(10, 'Family Room', 'Canary')
    location = mock_location('Home')
    data = Mock()
    data.get_reading.return_value = 0.4
    sensor = CanarySensor(data, SENSOR_TYPES[2], location, device)
    sensor.update()
    assert ('Home Family Room Air Quality' == sensor.name)
    assert (sensor.unit_of_measurement is None)
    assert (0.4 == sensor.state)
    assert ('mdi:weather-windy' == sensor.icon)
    air_quality = sensor.device_state_attributes[ATTR_AIR_QUALITY]
    assert (STATE_AIR_QUALITY_VERY_ABNORMAL == air_quality)
Test air quality sensor.
def test_air_quality_sensor_with_very_abnormal_reading(self):
    
    device = mock_device(10, 'Family Room', 'Canary')
    location = mock_location('Home')
    data = Mock()
    data.get_reading.return_value = 0.4
    sensor = CanarySensor(data, SENSOR_TYPES[2], location, device)
    sensor.update()
    assert ('Home Family Room Air Quality' == sensor.name)
    assert (sensor.unit_of_measurement is None)
    assert (0.4 == sensor.state)
    assert ('mdi:weather-windy' == sensor.icon)
    air_quality = sensor.device_state_attributes[ATTR_AIR_QUALITY]
    assert (STATE_AIR_QUALITY_VERY_ABNORMAL == air_quality)