MCPcopy
hub / github.com/helm/helm / TestChartValuesContainsIsRoot

Function TestChartValuesContainsIsRoot

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

Source from the content-addressed store, hash-verified

597}
598
599func TestChartValuesContainsIsRoot(t *testing.T) {
600 modTime := time.Now()
601 ch1 := &chart.Chart{
602 Metadata: &chart.Metadata{Name: "parent"},
603 Templates: []*common.File{
604 {Name: "templates/isroot", ModTime: modTime, Data: []byte("{{.Chart.IsRoot}}")},
605 },
606 }
607 dep1 := &chart.Chart{
608 Metadata: &chart.Metadata{Name: "child"},
609 Templates: []*common.File{
610 {Name: "templates/isroot", ModTime: modTime, Data: []byte("{{.Chart.IsRoot}}")},
611 },
612 }
613 ch1.AddDependency(dep1)
614
615 out, err := Render(ch1, common.Values{})
616 if err != nil {
617 t.Fatalf("failed to render templates: %s", err)
618 }
619 expects := map[string]string{
620 "parent/charts/child/templates/isroot": "false",
621 "parent/templates/isroot": "true",
622 }
623 for file, expect := range expects {
624 if out[file] != expect {
625 t.Errorf("Expected %q, got %q", expect, out[file])
626 }
627 }
628}
629
630func TestRenderDependency(t *testing.T) {
631 deptpl := `{{define "myblock"}}World{{end}}`

Callers

nothing calls this directly

Calls 4

AddDependencyMethod · 0.95
RenderFunction · 0.85
NowMethod · 0.80
FatalfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…