def test_template_complex():
    'Test template_complex validator.'
    schema = vol.Schema(cv.template_complex)
    for value in (None, '{{ partial_print }', '{% if True %}Hello'):
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    options = (1, 'Hello', '{{ beer }}', '{% if 1 == 1 %}Hello{% else %}World{% endif %}', {'test': 1, 'test2': '{{ beer }}'}, ['{{ beer }}', 1])
    for value in options:
        schema(value)
Test template_complex validator.
def test_template_complex():
    
    schema = vol.Schema(cv.template_complex)
    for value in (None, '{{ partial_print }', '{% if True %}Hello'):
        with pytest.raises(vol.MultipleInvalid):
            schema(value)
    options = (1, 'Hello', '{{ beer }}', '{% if 1 == 1 %}Hello{% else %}World{% endif %}', {'test': 1, 'test2': '{{ beer }}'}, ['{{ beer }}', 1])
    for value in options:
        schema(value)