(t *testing.T)
| 597 | } |
| 598 | |
| 599 | func 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 | |
| 630 | func TestRenderDependency(t *testing.T) { |
| 631 | deptpl := `{{define "myblock"}}World{{end}}` |
nothing calls this directly
no test coverage detected
searching dependent graphs…