MCPcopy
hub / github.com/helm/helm / TestAlterFuncMap_tplinclude

Function TestAlterFuncMap_tplinclude

pkg/engine/engine_test.go:984–1013  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

982}
983
984func TestAlterFuncMap_tplinclude(t *testing.T) {
985 modTime := time.Now()
986 c := &chart.Chart{
987 Metadata: &chart.Metadata{Name: "TplFunction"},
988 Templates: []*common.File{
989 {Name: "templates/base", ModTime: modTime, Data: []byte(`{{ tpl "{{include ` + "`" + `TplFunction/templates/_partial` + "`" + ` . | quote }}" .}}`)},
990 {Name: "templates/_partial", ModTime: modTime, Data: []byte(`{{.Template.Name}}`)},
991 },
992 }
993 v := common.Values{
994 "Values": common.Values{
995 "value": "myvalue",
996 },
997 "Chart": c.Metadata,
998 "Release": common.Values{
999 "Name": "TestRelease",
1000 },
1001 }
1002
1003 out, err := Render(c, v)
1004 if err != nil {
1005 t.Fatal(err)
1006 }
1007
1008 expect := "\"TplFunction/templates/base\""
1009 if got := out["TplFunction/templates/base"]; got != expect {
1010 t.Errorf("Expected %q, got %q (%v)", expect, got, out)
1011 }
1012
1013}
1014
1015func TestRenderRecursionLimit(t *testing.T) {
1016 modTime := time.Now()

Callers

nothing calls this directly

Calls 3

RenderFunction · 0.85
NowMethod · 0.80
FatalMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…