def test_entity_id():
    schema = vol.Schema(cv.entity_id)

    with pytest.raises(vol.MultipleInvalid):
        schema('invalid_entity')

    assert 'sensor.light' == schema('sensor.LIGHT')
Test entity ID validation.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_config_validation.py/test_entity_id