Skip to content

Commit

Permalink
add additional inclusion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Mar 15, 2022
1 parent 81598bc commit 804a7c7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ def test_plain(templater):
first: foo
second: bar
main_key: main_val
- inclusion_1: foo
main_key: main_val
- inclusion_2:
1st: foo
2nd: bar
main_key: main_val
- inclusion_3:
1st: foo
main_key: main_val
- inclusion_4:
1st: foo
2nd: bar
main_key: main_val
added:
indent:
foo:
Expand Down
2 changes: 2 additions & 0 deletions tests/yaml/_inclusion.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ _foo = "foo" }}
inclusion_1: {{ =_foo }}
5 changes: 5 additions & 0 deletions tests/yaml/_inclusion.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{ _foo = "foo" }}
{{ _bar = "bar" }}
inclusion_2:
1st: {{ =_foo }}
2nd: {{ =_bar }}
3 changes: 3 additions & 0 deletions tests/yaml/_inclusion.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
inclusion_3:
{{ _foo = "foo" }}
1st: {{ =_foo }}
5 changes: 5 additions & 0 deletions tests/yaml/_inclusion.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
inclusion_4:
{{ _foo = "foo" }}
{{ _bar = "bar" }}
1st: {{ =_foo }}
2nd: {{ =_bar }}
8 changes: 8 additions & 0 deletions tests/yaml/nested.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ array:
inclusion:
- {{ include '_inclusion.yaml' }}
main_key: main_val
- {{ include '_inclusion.1.yaml' }}
main_key: main_val
- {{ include '_inclusion.2.yaml' }}
main_key: main_val
- {{ include '_inclusion.3.yaml' }}
main_key: main_val
- {{ include '_inclusion.4.yaml' }}
main_key: main_val
added:
indent:
{{ =indent(additional, 4) }}
Expand Down

0 comments on commit 804a7c7

Please sign in to comment.