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

Function TestLoadFiles

internal/chart/v3/loader/load_test.go:187–265  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

185}
186
187func TestLoadFiles(t *testing.T) {
188 modTime := time.Now()
189 goodFiles := []*archive.BufferedFile{
190 {
191 Name: "Chart.yaml",
192 ModTime: modTime,
193 Data: []byte(`apiVersion: v3
194name: frobnitz
195description: This is a frobnitz.
196version: "1.2.3"
197keywords:
198 - frobnitz
199 - sprocket
200 - dodad
201maintainers:
202 - name: The Helm Team
203 email: helm@example.com
204 - name: Someone Else
205 email: nobody@example.com
206sources:
207 - https://example.com/foo/bar
208home: http://example.com
209icon: https://example.com/64x64.png
210`),
211 },
212 {
213 Name: "values.yaml",
214 ModTime: modTime,
215 Data: []byte("var: some values"),
216 },
217 {
218 Name: "values.schema.json",
219 ModTime: modTime,
220 Data: []byte("type: Values"),
221 },
222 {
223 Name: "templates/deployment.yaml",
224 ModTime: modTime,
225 Data: []byte("some deployment"),
226 },
227 {
228 Name: "templates/service.yaml",
229 ModTime: modTime,
230 Data: []byte("some service"),
231 },
232 }
233
234 c, err := LoadFiles(goodFiles)
235 if err != nil {
236 t.Errorf("Expected good files to be loaded, got %v", err)
237 }
238
239 if c.Name() != "frobnitz" {
240 t.Errorf("Expected chart name to be 'frobnitz', got %s", c.Name())
241 }
242
243 if c.Values["var"] != "some values" {
244 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…