MCPcopy
hub / github.com/helm/helm / TestPullCmd

Function TestPullCmd

pkg/cmd/pull_test.go:31–276  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29)
30
31func TestPullCmd(t *testing.T) {
32 srv := repotest.NewTempServer(
33 t,
34 repotest.WithChartSourceGlob("testdata/testcharts/*.tgz*"),
35 )
36 defer srv.Stop()
37
38 ociSrv, err := repotest.NewOCIServer(t, srv.Root())
39 if err != nil {
40 t.Fatal(err)
41 }
42 ociSrv.Run(t)
43
44 if err := srv.LinkIndices(); err != nil {
45 t.Fatal(err)
46 }
47
48 helmTestKeyOut := "Signed by: Helm Testing (This key should only be used for testing. DO NOT TRUST.) <helm-testing@helm.sh>\n" +
49 "Using Key With Fingerprint: 5E615389B53CA37F0EE60BD3843BBF981FC18762\n" +
50 "Chart Hash Verified: "
51
52 // all flags will get "-d outdir" appended.
53 tests := []struct {
54 name string
55 args string
56 existFile string
57 existDir string
58 wantError bool
59 wantErrorMsg string
60 failExpect string
61 expectFile string
62 expectDir bool
63 expectVerify bool
64 expectSha string
65 }{
66 {
67 name: "Basic chart fetch",
68 args: "test/signtest",
69 expectFile: "./signtest-0.1.0.tgz",
70 },
71 {
72 name: "Chart fetch with version",
73 args: "test/signtest --version=0.1.0",
74 expectFile: "./signtest-0.1.0.tgz",
75 },
76 {
77 name: "Fail chart fetch with non-existent version",
78 args: "test/signtest --version=99.1.0",
79 wantError: true,
80 failExpect: "no such chart",
81 },
82 {
83 name: "Fail fetching non-existent chart",
84 args: "test/nosuchthing",
85 failExpect: "Failed to fetch",
86 wantError: true,
87 },
88 {

Callers

nothing calls this directly

Calls 15

RunMethod · 0.95
NewTempServerFunction · 0.92
WithChartSourceGlobFunction · 0.92
NewOCIServerFunction · 0.92
executeActionCommandFunction · 0.85
StopMethod · 0.80
FatalMethod · 0.80
LinkIndicesMethod · 0.80
URLMethod · 0.80
FatalfMethod · 0.80
RunMethod · 0.65
DirMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…