MCPcopy
hub / github.com/helm/helm / TestAllTemplates

Function TestAllTemplates

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

Source from the content-addressed store, hash-verified

565}
566
567func TestAllTemplates(t *testing.T) {
568 modTime := time.Now()
569 ch1 := &chart.Chart{
570 Metadata: &chart.Metadata{Name: "ch1"},
571 Templates: []*common.File{
572 {Name: "templates/foo", ModTime: modTime, Data: []byte("foo")},
573 {Name: "templates/bar", ModTime: modTime, Data: []byte("bar")},
574 },
575 }
576 dep1 := &chart.Chart{
577 Metadata: &chart.Metadata{Name: "laboratory mice"},
578 Templates: []*common.File{
579 {Name: "templates/pinky", ModTime: modTime, Data: []byte("pinky")},
580 {Name: "templates/brain", ModTime: modTime, Data: []byte("brain")},
581 },
582 }
583 ch1.AddDependency(dep1)
584
585 dep2 := &chart.Chart{
586 Metadata: &chart.Metadata{Name: "same thing we do every night"},
587 Templates: []*common.File{
588 {Name: "templates/innermost", ModTime: modTime, Data: []byte("innermost")},
589 },
590 }
591 dep1.AddDependency(dep2)
592
593 tpls := allTemplates(ch1, common.Values{})
594 if len(tpls) != 5 {
595 t.Errorf("Expected 5 charts, got %d", len(tpls))
596 }
597}
598
599func TestChartValuesContainsIsRoot(t *testing.T) {
600 modTime := time.Now()

Callers

nothing calls this directly

Calls 3

AddDependencyMethod · 0.95
allTemplatesFunction · 0.85
NowMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…