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