Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.template
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.recipe.template
Commits
36d4fba9
Commit
36d4fba9
authored
Feb 01, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jinja2: use new output/inline/url options in tests
parent
7fa2695a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
slapos/recipe/template/README.jinja2.txt
slapos/recipe/template/README.jinja2.txt
+24
-24
No files found.
slapos/recipe/template/README.jinja2.txt
View file @
36d4fba9
...
@@ -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...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment