(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestMemoryCreate(t *testing.T) { |
| 38 | var tests = []struct { |
| 39 | desc string |
| 40 | rls *rspb.Release |
| 41 | err bool |
| 42 | }{ |
| 43 | { |
| 44 | "create should succeed", |
| 45 | releaseStub("rls-c", 1, "default", common.StatusDeployed), |
| 46 | false, |
| 47 | }, |
| 48 | { |
| 49 | "create should fail (release already exists)", |
| 50 | releaseStub("rls-a", 1, "default", common.StatusDeployed), |
| 51 | true, |
| 52 | }, |
| 53 | { |
| 54 | "create in namespace should succeed", |
| 55 | releaseStub("rls-a", 1, "mynamespace", common.StatusDeployed), |
| 56 | false, |
| 57 | }, |
| 58 | { |
| 59 | "create in other namespace should fail (release already exists)", |
| 60 | releaseStub("rls-c", 1, "mynamespace", common.StatusDeployed), |
| 61 | true, |
| 62 | }, |
| 63 | } |
| 64 | |
| 65 | ts := tsFixtureMemory(t) |
| 66 | for _, tt := range tests { |
| 67 | key := testKey(tt.rls.Name, tt.rls.Version) |
| 68 | rls := tt.rls |
| 69 | |
| 70 | if err := ts.Create(key, rls); err != nil { |
| 71 | if !tt.err { |
| 72 | t.Fatalf("failed to create %q: %s", tt.desc, err) |
| 73 | } |
| 74 | } else if tt.err { |
| 75 | t.Fatalf("Did not get expected error for %q\n", tt.desc) |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func TestMemoryGet(t *testing.T) { |
| 81 | var tests = []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…