add test case

Signed-off-by: zwwhdls <zwwhdls@hotmail.com>
pull/7114/head
zwwhdls 6 years ago
parent a5d483a509
commit 59eab1e4d0

@ -460,6 +460,15 @@ func TestAlterFuncMap_include(t *testing.T) {
},
}
// Check nested reference in include FuncMap
d := &chart.Chart{
Metadata: &chart.Metadata{Name: "nested"},
Templates: []*chart.File{
{Name: "templates/quote", Data: []byte(`{{include "nested/templates/quote" . | indent 2}} dead.`)},
{Name: "templates/_partial", Data: []byte(`{{.Release.Name}} - he`)},
},
}
v := chartutil.Values{
"Values": "",
"Chart": c.Metadata,
@ -477,6 +486,12 @@ func TestAlterFuncMap_include(t *testing.T) {
if got := out["conrad/templates/quote"]; got != expect {
t.Errorf("Expected %q, got %q (%v)", expect, got, out)
}
out, err = Render(d, v)
expectErrName := "nested/templates/quote"
if err == nil {
t.Errorf("Expected err of nested reference name: %v", expectErrName)
}
}
func TestAlterFuncMap_require(t *testing.T) {

Loading…
Cancel
Save