MCPcopy
hub / github.com/helm/helm / TestMemoryGet

Function TestMemoryGet

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

Source from the content-addressed store, hash-verified

78}
79
80func TestMemoryGet(t *testing.T) {
81 var tests = []struct {
82 desc string
83 key string
84 namespace string
85 err bool
86 }{
87 {"release key should exist", "rls-a.v1", "default", false},
88 {"release key should not exist", "rls-a.v5", "default", true},
89 {"release key in namespace should exist", "rls-c.v1", "mynamespace", false},
90 {"release key in namespace should not exist", "rls-a.v1", "mynamespace", true},
91 }
92
93 ts := tsFixtureMemory(t)
94 for _, tt := range tests {
95 ts.SetNamespace(tt.namespace)
96 if _, err := ts.Get(tt.key); err != nil {
97 if !tt.err {
98 t.Fatalf("Failed %q to get '%s': %q\n", tt.desc, tt.key, err)
99 }
100 } else if tt.err {
101 t.Fatalf("Did not get expected error for %q '%s'\n", tt.desc, tt.key)
102 }
103 }
104}
105
106func TestMemoryList(t *testing.T) {
107 ts := tsFixtureMemory(t)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…