Commit b55df9c7 authored by Julien Muchembled's avatar Julien Muchembled

tests: check that a jinja2 error reports which file fails to render

parent 4f213d38
......@@ -514,6 +514,34 @@ Let's just use ``buildout.cfg`` using this egg::
>>> cat('foo')
foobar
Errors in template
~~~~~~~~~~~~~~~~~~
>>> write('template.in', '''\
... foo
... {%
... bar
... ''')
>>> write('buildout.cfg', '''
... [buildout]
... parts = template
...
... [template]
... recipe = slapos.recipe.template:jinja2
... template = template.in
... rendered = foo
... ''')
>>> 0; run_buildout() # doctest: +ELLIPSIS
0...
While:
Installing template.
...
Traceback (most recent call last):
...
File "template.in", line 3, in template
bar
...TemplateSyntaxError: Encountered unknown tag 'bar'.
Avoiding file re-creation
~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -535,16 +563,9 @@ rendering.
... rendered = foo_once
... once = foo_flag
... ''')
>>> run_buildout() # doctest: +ELLIPSIS
Uninstalling template.
Uninstalling sample.
Getting distribution for 'samplerecipe'.
Got samplerecipe 0.0.0.
>>> run_buildout()
Installing template.
The template install returned None. A path or iterable os paths should be returned.
warning: install_lib: '...' does not exist -- no Python modules to install
<BLANKLINE>
zip_safe flag not set; analyzing archive contents...
Template was rendered::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment