def test_humidity_sensor(self):
    'Test humidity sensor.'
    device = mock_device(10, 'Family Room', 'Canary')
    location = mock_location('Home')
    data = Mock()
    data.get_reading.return_value = 50.4567
    sensor = CanarySensor(data, SENSOR_TYPES[1], location, device)
    sensor.update()
    assert ('Home Family Room Humidity' == sensor.name)
    assert ('%' == sensor.unit_of_measurement)
    assert (50.46 == sensor.state)
    assert ('mdi:water-percent' == sensor.icon)
Test humidity sensor.
def test_humidity_sensor(self):
    
    device = mock_device(10, 'Family Room', 'Canary')
    location = mock_location('Home')
    data = Mock()
    data.get_reading.return_value = 50.4567
    sensor = CanarySensor(data, SENSOR_TYPES[1], location, device)
    sensor.update()
    assert ('Home Family Room Humidity' == sensor.name)
    assert ('%' == sensor.unit_of_measurement)
    assert (50.46 == sensor.state)
    assert ('mdi:water-percent' == sensor.icon)