implemented nil err checks, cc @yujuhong @davidopp

This commit is contained in:
James DeFelice 2015-03-06 07:02:04 +00:00
parent e5350d61a8
commit 4943fe937b

View File

@ -866,11 +866,17 @@ func TestEtcdCreateBindingNoPod(t *testing.T) {
// - Schedule (scheduler)
// - Delete (apiserver)
_, err := bindingRegistry.Create(ctx, &api.Binding{PodID: "foo", Host: "machine", ObjectMeta: api.ObjectMeta{Namespace: api.NamespaceDefault}})
if err == nil {
t.Fatalf("Expected not-found-error but got nothing")
}
if !errors.IsNotFound(etcderrors.InterpretGetError(err, "Pod", "foo")) {
t.Fatalf("Unexpected error returned: %#v", err)
}
_, err = registry.Get(ctx, "foo")
if err == nil {
t.Fatalf("Expected not-found-error but got nothing")
}
if !errors.IsNotFound(etcderrors.InterpretGetError(err, "Pod", "foo")) {
t.Fatalf("Unexpected error: %v", err)
}