MCPcopy
hub / github.com/helm/helm / TestMemoryList

Function TestMemoryList

pkg/storage/driver/memory_test.go:106–148  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestMemoryList(t *testing.T) {
107 ts := tsFixtureMemory(t)
108 ts.SetNamespace("default")
109
110 // list all deployed releases
111 dpl, err := ts.List(func(rel release.Releaser) bool {
112 rls := convertReleaserToV1(t, rel)
113 return rls.Info.Status == common.StatusDeployed
114 })
115 // check
116 if err != nil {
117 t.Errorf("Failed to list deployed releases: %s", err)
118 }
119 if len(dpl) != 2 {
120 t.Errorf("Expected 2 deployed, got %d", len(dpl))
121 }
122
123 // list all superseded releases
124 ssd, err := ts.List(func(rel release.Releaser) bool {
125 rls := convertReleaserToV1(t, rel)
126 return rls.Info.Status == common.StatusSuperseded
127 })
128 // check
129 if err != nil {
130 t.Errorf("Failed to list superseded releases: %s", err)
131 }
132 if len(ssd) != 6 {
133 t.Errorf("Expected 6 superseded, got %d", len(ssd))
134 }
135
136 // list all deleted releases
137 del, err := ts.List(func(rel release.Releaser) bool {
138 rls := convertReleaserToV1(t, rel)
139 return rls.Info.Status == common.StatusUninstalled
140 })
141 // check
142 if err != nil {
143 t.Errorf("Failed to list deleted releases: %s", err)
144 }
145 if len(del) != 0 {
146 t.Errorf("Expected 0 deleted, got %d", len(del))
147 }
148}
149
150func TestMemoryQuery(t *testing.T) {
151 var tests = []struct {

Callers

nothing calls this directly

Calls 4

tsFixtureMemoryFunction · 0.85
convertReleaserToV1Function · 0.85
ListMethod · 0.65
SetNamespaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…