def test_entity_ids():
 schema = vol.Schema(cv.entity_ids)
 options = ('invalid_entity', 'sensor.light,sensor_invalid', ['invalid_entity'], ['sensor.light', 'sensor_invalid'], ['sensor.light,sensor_invalid'])
 for value in options:
  with pytest.raises(vol.MultipleInvalid):
   schema(value)
 options = ([], ['sensor.light'], 'sensor.light')
 for value in options:
  schema(value)
 assert (schema('sensor.LIGHT, light.kitchen ') == ['sensor.light', 'light.kitchen'])

def test_entity_ids ( ) : schema = vol . Schema ( cv . entity_ids ) options = ( 'invalid_entity' , 'sensor.light,sensor_invalid' , [ 'invalid_entity' ] , [ 'sensor.light' , 'sensor_invalid' ] , [ 'sensor.light,sensor_invalid' ] ) for value in options : with pytest . raises ( vol . MultipleInvalid ) : schema ( value ) options = ( [ ] , [ 'sensor.light' ] , 'sensor.light' ) for value in options : schema ( value ) assert ( schema ( 'sensor.LIGHT, light.kitchen ' ) == [ 'sensor.light' , 'light.kitchen' ] )
test entity id validation .