MCPcopy
hub / github.com/helm/helm / TestValidateChartIconPresence

Function TestValidateChartIconPresence

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

Source from the content-addressed store, hash-verified

204}
205
206func TestValidateChartIconPresence(t *testing.T) {
207 t.Run("Icon absent", func(t *testing.T) {
208 testChart := &chart.Metadata{
209 Icon: "",
210 }
211
212 err := validateChartIconPresence(testChart)
213
214 if err == nil {
215 t.Error("validateChartIconPresence to return a linter error, got no error")
216 } else if !strings.Contains(err.Error(), "icon is recommended") {
217 t.Errorf("expected %q, got %q", "icon is recommended", err.Error())
218 }
219 })
220 t.Run("Icon present", func(t *testing.T) {
221 testChart := &chart.Metadata{
222 Icon: "http://example.org/icon.png",
223 }
224
225 err := validateChartIconPresence(testChart)
226
227 if err != nil {
228 t.Errorf("Unexpected error: %q", err.Error())
229 }
230 })
231}
232
233func TestValidateChartIconURL(t *testing.T) {
234 var failTest = []string{"RiverRun", "john@winterfell", "riverrun.io"}

Callers

nothing calls this directly

Calls 4

ContainsMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…