def test_template():
    'Test template validator.'
    schema = vol.Schema(cv.template)
    for value in (None, '{{ partial_print }', '{% if True %}Hello', ['test']):
        with pytest.raises(vol.Invalid, message='{} not considered invalid'.format(value)):
            schema(value)
    options = (1, 'Hello', '{{ beer }}', '{% if 1 == 1 %}Hello{% else %}World{% endif %}')
    for value in options:
        schema(value)
Test template validator.
def test_template():
    
    schema = vol.Schema(cv.template)
    for value in (None, '{{ partial_print }', '{% if True %}Hello', ['test']):
        with pytest.raises(vol.Invalid, message='{} not considered invalid'.format(value)):
            schema(value)
    options = (1, 'Hello', '{{ beer }}', '{% if 1 == 1 %}Hello{% else %}World{% endif %}')
    for value in options:
        schema(value)