MCPcopy
hub / github.com/helm/helm / TestLoadFiles_BadCases

Function TestLoadFiles_BadCases

pkg/chart/v2/loader/load_test.go:213–238  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

211}
212
213func TestLoadFiles_BadCases(t *testing.T) {
214 for _, tt := range []struct {
215 name string
216 bufferedFiles []*archive.BufferedFile
217 expectError string
218 }{
219 {
220 name: "These files contain only requirements.lock",
221 bufferedFiles: []*archive.BufferedFile{
222 {
223 Name: "requirements.lock",
224 ModTime: time.Now(),
225 Data: []byte(""),
226 },
227 },
228 expectError: "validation: chart.metadata.apiVersion is required"},
229 } {
230 _, err := LoadFiles(tt.bufferedFiles)
231 if err == nil {
232 t.Fatal("expected error when load illegal files")
233 }
234 if !strings.Contains(err.Error(), tt.expectError) {
235 t.Errorf("Expected error to contain %q, got %q for %s", tt.expectError, err.Error(), tt.name)
236 }
237 }
238}
239
240func TestLoadFiles(t *testing.T) {
241 modTime := time.Now()

Callers

nothing calls this directly

Calls 5

NowMethod · 0.80
FatalMethod · 0.80
ContainsMethod · 0.80
LoadFilesFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…