def test_service():
 schema = vol.Schema(cv.service)
 with pytest.raises(vol.MultipleInvalid):
  schema('invalid_turn_on')
 schema('homeassistant.turn_on')

def test_service ( ) : schema = vol . Schema ( cv . service ) with pytest . raises ( vol . MultipleInvalid ) : schema ( 'invalid_turn_on' ) schema ( 'homeassistant.turn_on' )
test service validation .