}
# Get the tag
- tag, template = template.split(r_del, 1)
+ try:
+ tag, template = template.split(r_del, 1)
+ except ValueError:
+ raise ChevronError('unclosed tag '
+ 'at line {0}'.format(_CURRENT_LINE))
# Find the type meaning of the first character
tag_type = tag_types.get(tag[0], 'variable')
self.assertEqual(result, expected)
+ def test_closing_tag_only(self):
+ args = {
+ 'template': '{{ foo } bar',
+ 'data': {'foo': 'xx'}
+ }
+
+ self.assertRaises(chevron.ChevronError, chevron.render, **args)
+
# Run unit tests from command line
if __name__ == "__main__":