MCPcopy
hub / github.com/helm/helm / TestLoadFiles

Function TestLoadFiles

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

Source from the content-addressed store, hash-verified

238}
239
240func TestLoadFiles(t *testing.T) {
241 modTime := time.Now()
242 goodFiles := []*archive.BufferedFile{
243 {
244 Name: "Chart.yaml",
245 ModTime: modTime,
246 Data: []byte(`apiVersion: v1
247name: frobnitz
248description: This is a frobnitz.
249version: "1.2.3"
250keywords:
251 - frobnitz
252 - sprocket
253 - dodad
254maintainers:
255 - name: The Helm Team
256 email: helm@example.com
257 - name: Someone Else
258 email: nobody@example.com
259sources:
260 - https://example.com/foo/bar
261home: http://example.com
262icon: https://example.com/64x64.png
263`),
264 },
265 {
266 Name: "values.yaml",
267 ModTime: modTime,
268 Data: []byte("var: some values"),
269 },
270 {
271 Name: "values.schema.json",
272 ModTime: modTime,
273 Data: []byte("type: Values"),
274 },
275 {
276 Name: "templates/deployment.yaml",
277 ModTime: modTime,
278 Data: []byte("some deployment"),
279 },
280 {
281 Name: "templates/service.yaml",
282 ModTime: modTime,
283 Data: []byte("some service"),
284 },
285 }
286
287 c, err := LoadFiles(goodFiles)
288 if err != nil {
289 t.Errorf("Expected good files to be loaded, got %v", err)
290 }
291
292 if c.Name() != "frobnitz" {
293 t.Errorf("Expected chart name to be 'frobnitz', got %s", c.Name())
294 }
295
296 if c.Values["var"] != "some values" {
297 t.Error("Expected chart values to be populated with default values")

Callers

nothing calls this directly

Calls 5

NowMethod · 0.80
FatalMethod · 0.80
LoadFilesFunction · 0.70
NameMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…