def test_entities_domain():
    'Test entities domain validation.'
    schema = vol.Schema(cv.entities_domain('sensor'))
    options = (None, '', 'invalid_entity', ['sensor.light', 'cover.demo'], ['sensor.light', 'sensor_invalid'])
    for value in options:
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    options = ('sensor.light', ['SENSOR.light'], ['sensor.light', 'sensor.demo'])
    for value in options:
        schema(value)
    assert (schema('sensor.LIGHT, sensor.demo ') == ['sensor.light', 'sensor.demo'])
    assert (schema(['sensor.light', 'SENSOR.demo']) == ['sensor.light', 'sensor.demo'])
Test entities domain validation.
def test_entities_domain():
    
    schema = vol.Schema(cv.entities_domain('sensor'))
    options = (None, , 'invalid_entity', ['sensor.light', 'cover.demo'], ['sensor.light', 'sensor_invalid'])
    for value in options:
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    options = ('sensor.light', ['SENSOR.light'], ['sensor.light', 'sensor.demo'])
    for value in options:
        schema(value)
    assert (schema('sensor.LIGHT, sensor.demo ') == ['sensor.light', 'sensor.demo'])
    assert (schema(['sensor.light', 'SENSOR.demo']) == ['sensor.light', 'sensor.demo'])