(t *testing.T)
| 162 | } |
| 163 | |
| 164 | func TestConfigMapQuery(t *testing.T) { |
| 165 | cfgmaps := newTestFixtureCfgMaps(t, []*rspb.Release{ |
| 166 | releaseStub("key-1", 1, "default", common.StatusUninstalled), |
| 167 | releaseStub("key-2", 1, "default", common.StatusUninstalled), |
| 168 | releaseStub("key-3", 1, "default", common.StatusDeployed), |
| 169 | releaseStub("key-4", 1, "default", common.StatusDeployed), |
| 170 | releaseStub("key-5", 1, "default", common.StatusSuperseded), |
| 171 | releaseStub("key-6", 1, "default", common.StatusSuperseded), |
| 172 | }...) |
| 173 | |
| 174 | rls, err := cfgmaps.Query(map[string]string{"status": "deployed"}) |
| 175 | if err != nil { |
| 176 | t.Errorf("Failed to query: %s", err) |
| 177 | } |
| 178 | if len(rls) != 2 { |
| 179 | t.Errorf("Expected 2 results, got %d", len(rls)) |
| 180 | } |
| 181 | |
| 182 | _, err = cfgmaps.Query(map[string]string{"name": "notExist"}) |
| 183 | if !errors.Is(err, ErrReleaseNotFound) { |
| 184 | t.Errorf("Expected {%v}, got {%v}", ErrReleaseNotFound, err) |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | func TestConfigMapCreate(t *testing.T) { |
| 189 | cfgmaps := newTestFixtureCfgMaps(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…