MCPcopy
hub / github.com/helm/helm / verifyChartfile

Function verifyChartfile

pkg/chart/v2/util/chartfile_test.go:36–108  ·  view source on GitHub ↗
(t *testing.T, f *chart.Metadata, name string)

Source from the content-addressed store, hash-verified

34}
35
36func verifyChartfile(t *testing.T, f *chart.Metadata, name string) {
37 t.Helper()
38 if f == nil {
39 t.Fatal("Failed verifyChartfile because f is nil")
40 }
41
42 if f.APIVersion != chart.APIVersionV1 {
43 t.Errorf("Expected API Version %q, got %q", chart.APIVersionV1, f.APIVersion)
44 }
45
46 if f.Name != name {
47 t.Errorf("Expected %s, got %s", name, f.Name)
48 }
49
50 if f.Description != "This is a frobnitz." {
51 t.Errorf("Unexpected description %q", f.Description)
52 }
53
54 if f.Version != "1.2.3" {
55 t.Errorf("Unexpected version %q", f.Version)
56 }
57
58 if len(f.Maintainers) != 2 {
59 t.Errorf("Expected 2 maintainers, got %d", len(f.Maintainers))
60 }
61
62 if f.Maintainers[0].Name != "The Helm Team" {
63 t.Error("Unexpected maintainer name.")
64 }
65
66 if f.Maintainers[1].Email != "nobody@example.com" {
67 t.Error("Unexpected maintainer email.")
68 }
69
70 if len(f.Sources) != 1 {
71 t.Fatal("Unexpected number of sources")
72 }
73
74 if f.Sources[0] != "https://example.com/foo/bar" {
75 t.Errorf("Expected https://example.com/foo/bar, got %s", f.Sources)
76 }
77
78 if f.Home != "http://example.com" {
79 t.Error("Unexpected home.")
80 }
81
82 if f.Icon != "https://example.com/64x64.png" {
83 t.Errorf("Unexpected icon: %q", f.Icon)
84 }
85
86 if len(f.Keywords) != 3 {
87 t.Error("Unexpected keywords")
88 }
89
90 if len(f.Annotations) != 2 {
91 t.Fatal("Unexpected annotations")
92 }
93

Callers 1

TestLoadChartfileFunction · 0.70

Calls 3

HelperMethod · 0.80
FatalMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…