fix panic in memory_test when release status is nil

pull/1008/head
fibonacci1729 8 years ago
parent aff817a1fc
commit 061b534885

@ -73,7 +73,12 @@ func TestMemoryUpdate(t *testing.T) {
func TestMemoryDelete(t *testing.T) {
key := "test-1"
rls := &rspb.Release{Name: key}
rls := &rspb.Release{
Name: key,
Info: &rspb.Info{
Status: &rspb.Status{Code: rspb.Status_DEPLOYED},
},
}
mem := NewMemory()
if err := mem.Create(rls); err != nil {
@ -86,7 +91,7 @@ func TestMemoryDelete(t *testing.T) {
t.Fatalf("Failed delete: %s", err)
case mem.cache[key] != nil:
t.Errorf("Expected nil, got %s", mem.cache[key])
case res.Info.Status.Code != release.Status_DELETED:
case res.Info.Status.Code != rspb.Status_DELETED:
t.Errorf("Expected Status_DELETED, got %s", res.Info.Status.Code)
}
}

Loading…
Cancel
Save