-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store the replace and insert annotations' "via" kwarg as callable
- Loading branch information
1 parent
486de37
commit d413e22
Showing
4 changed files
with
92 additions
and
50 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
pkg/yamltemplate/filetests/ytt-library/overlay/insert-into-via-err.tpltest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#@ load("@ytt:template", "template") | ||
#@ load("@ytt:overlay", "overlay") | ||
|
||
#@ def test1_left(): | ||
--- | ||
item: 1 | ||
#@ end | ||
|
||
#@ def test1_right(): | ||
#@overlay/match by=overlay.all, expects=1 | ||
#@overlay/insert before=True, via="not a function" | ||
--- | ||
#@ end | ||
|
||
--- #@ template.replace(overlay.apply(test1_left(), test1_right())) | ||
|
||
+++ | ||
|
||
ERR: | ||
- overlay.apply: Document on line stdin:12: Expected 'overlay/insert' annotation keyword argument 'via' to be function, but was starlark.String | ||
in <toplevel> | ||
stdin:15 | --- #@ template.replace(overlay.apply(test1_left(), test1_right())) |
22 changes: 22 additions & 0 deletions
22
pkg/yamltemplate/filetests/ytt-library/overlay/replace-func-err.tpltest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#@ load("@ytt:template", "template") | ||
#@ load("@ytt:overlay", "overlay") | ||
|
||
#@ def test1_left(): | ||
--- | ||
item: 1 | ||
#@ end | ||
|
||
#@ def test1_right(): | ||
#@overlay/match by=overlay.all, expects=1 | ||
#@overlay/replace via="not a function" | ||
--- | ||
#@ end | ||
|
||
--- #@ template.replace(overlay.apply(test1_left(), test1_right())) | ||
|
||
+++ | ||
|
||
ERR: | ||
- overlay.apply: Document on line stdin:12: Expected 'overlay/replace' annotation keyword argument 'via' to be function, but was starlark.String | ||
in <toplevel> | ||
stdin:15 | --- #@ template.replace(overlay.apply(test1_left(), test1_right())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters