MCPcopy
hub / github.com/helm/helm / TestMemoryQuery

Function TestMemoryQuery

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

Source from the content-addressed store, hash-verified

148}
149
150func TestMemoryQuery(t *testing.T) {
151 var tests = []struct {
152 desc string
153 xlen int
154 namespace string
155 lbs map[string]string
156 }{
157 {
158 "should be 2 query results",
159 2,
160 "default",
161 map[string]string{"status": "deployed"},
162 },
163 {
164 "should be 1 query result",
165 1,
166 "mynamespace",
167 map[string]string{"status": "deployed"},
168 },
169 }
170
171 ts := tsFixtureMemory(t)
172 for _, tt := range tests {
173 ts.SetNamespace(tt.namespace)
174 l, err := ts.Query(tt.lbs)
175 if err != nil {
176 t.Fatalf("Failed to query: %s\n", err)
177 }
178
179 if tt.xlen != len(l) {
180 t.Fatalf("Expected %d results, actual %d\n", tt.xlen, len(l))
181 }
182 }
183}
184
185func TestMemoryUpdate(t *testing.T) {
186 var tests = []struct {

Callers

nothing calls this directly

Calls 4

tsFixtureMemoryFunction · 0.85
FatalfMethod · 0.80
QueryMethod · 0.65
SetNamespaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…