MCPcopy
hub / github.com/helm/helm / TestValidateChartSources

Function TestValidateChartSources

pkg/chart/v2/lint/rules/chartfile_test.go:186–204  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func TestValidateChartSources(t *testing.T) {
187 var failTest = []string{"", "RiverRun", "john@winterfell", "riverrun.io"}
188 var successTest = []string{"http://riverrun.io", "https://riverrun.io", "https://riverrun.io/blackfish"}
189 for _, test := range failTest {
190 badChart.Sources = []string{test}
191 err := validateChartSources(badChart)
192 if err == nil || !strings.Contains(err.Error(), "invalid source URL") {
193 t.Errorf("validateChartSources(%s) to return \"invalid source URL\", got no error", test)
194 }
195 }
196
197 for _, test := range successTest {
198 badChart.Sources = []string{test}
199 err := validateChartSources(badChart)
200 if err != nil {
201 t.Errorf("validateChartSources(%s) to return no error, got %s", test, err.Error())
202 }
203 }
204}
205
206func TestValidateChartIconPresence(t *testing.T) {
207 t.Run("Icon absent", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

ContainsMethod · 0.80
validateChartSourcesFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…