Commit 36d4fba9 authored by Julien Muchembled's avatar Julien Muchembled

jinja2: use new output/inline/url options in tests

parent 7fa2695a
...@@ -25,8 +25,8 @@ Example demonstrating some types:: ...@@ -25,8 +25,8 @@ Example demonstrating some types::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = foo.in ... url = foo.in
... rendered = foo ... output = foo
... context = ... context =
... key bar section:key ... key bar section:key
... key recipe :recipe ... key recipe :recipe
...@@ -100,8 +100,8 @@ rendering:: ...@@ -100,8 +100,8 @@ rendering::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = inline:dummy ... inline = dummy
... rendered = foo_once ... output = foo_once
... once = foo_flag ... once = foo_flag
... ''') ... ''')
>>> run_buildout() >>> run_buildout()
...@@ -158,9 +158,9 @@ It's also possible to use the same file for ``rendered`` and ``once``:: ...@@ -158,9 +158,9 @@ It's also possible to use the same file for ``rendered`` and ``once``::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = inline:initial content ... inline = initial content
... rendered = rendered ... output = rendered
... once = ${:rendered} ... once = ${:output}
... ''') ... ''')
>>> run_buildout() # doctest: +ELLIPSIS >>> run_buildout() # doctest: +ELLIPSIS
Uninstalling template. Uninstalling template.
...@@ -175,7 +175,7 @@ Template was rendered:: ...@@ -175,7 +175,7 @@ Template was rendered::
When buildout options are modified, the template will not be rendered again:: When buildout options are modified, the template will not be rendered again::
>>> with open('buildout.cfg', 'a') as f: >>> with open('buildout.cfg', 'a') as f:
... f.writelines(['template = inline:something different']) ... f.writelines(['inline = something different'])
>>> run_buildout() >>> run_buildout()
Uninstalling template. Uninstalling template.
...@@ -223,8 +223,8 @@ will be installed as dependency:: ...@@ -223,8 +223,8 @@ will be installed as dependency::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = inline:{{bar}} ... inline = {{bar}}
... rendered = foo ... output = foo
... context = key bar dependency:foobar ... context = key bar dependency:foobar
... ...
... [dependency] ... [dependency]
...@@ -277,9 +277,9 @@ Let's just use ``buildout.cfg`` using this egg:: ...@@ -277,9 +277,9 @@ Let's just use ``buildout.cfg`` using this egg::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = inline: ... inline =
... {{bar}} ... {{bar}}
... rendered = foo ... output = foo
... context = key bar sample:data ... context = key bar sample:data
... ...
... [sample] ... [sample]
...@@ -314,8 +314,8 @@ whitespace-separated. By default, none is loaded. ...@@ -314,8 +314,8 @@ whitespace-separated. By default, none is loaded.
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = foo.in ... url = foo.in
... rendered = foo ... output = foo
... context = key bar buildout:parts ... context = key bar buildout:parts
... # We don't actually use all those extensions in this minimal example. ... # We don't actually use all those extensions in this minimal example.
... extensions = jinja2.ext.do jinja2.ext.loopcontrols ... extensions = jinja2.ext.do jinja2.ext.loopcontrols
...@@ -369,8 +369,8 @@ imported:: ...@@ -369,8 +369,8 @@ imported::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = template.in ... url = template.in
... rendered = bar ... output = bar
... import-list = rawfile library library.in ... import-list = rawfile library library.in
... ''') ... ''')
>>> run_buildout() >>> run_buildout()
...@@ -390,8 +390,8 @@ Just like context definition, it also works with indirect values:: ...@@ -390,8 +390,8 @@ Just like context definition, it also works with indirect values::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = template.in ... url = template.in
... rendered = bar ... output = bar
... import-list = file library template-library:path ... import-list = file library template-library:path
... ''') ... ''')
>>> run_buildout() >>> run_buildout()
...@@ -432,8 +432,8 @@ All templates can be accessed inside both folders:: ...@@ -432,8 +432,8 @@ All templates can be accessed inside both folders::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = template.in ... url = template.in
... rendered = bar ... output = bar
... import-list = ... import-list =
... rawfolder dir_a a ... rawfolder dir_a a
... rawfolder dir_b b ... rawfolder dir_b b
...@@ -469,8 +469,8 @@ path):: ...@@ -469,8 +469,8 @@ path)::
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = template.in ... url = template.in
... rendered = bar ... output = bar
... import-delimiter = \ ... import-delimiter = \
... import-list = ... import-list =
... rawfolder dir_a a ... rawfolder dir_a a
...@@ -517,8 +517,8 @@ Errors in template ...@@ -517,8 +517,8 @@ Errors in template
... ...
... [template] ... [template]
... recipe = slapos.recipe.template:jinja2 ... recipe = slapos.recipe.template:jinja2
... template = template.in ... url = template.in
... rendered = foo ... output = foo
... ''') ... ''')
>>> 0; run_buildout() # doctest: +ELLIPSIS >>> 0; run_buildout() # doctest: +ELLIPSIS
0... 0...
......
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