testing: remove use of docker/docker/errdefs in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
c37654e9d3
commit
570c5f9e76
1 changed files with 8 additions and 4 deletions
|
@ -10,7 +10,6 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/pkg/plugins"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/docker/libnetwork"
|
||||
|
@ -90,6 +89,11 @@ func getPortMapping() []types.PortBinding {
|
|||
}
|
||||
}
|
||||
|
||||
func isNotFound(err error) bool {
|
||||
_, ok := (err).(types.NotFoundError)
|
||||
return ok
|
||||
}
|
||||
|
||||
func TestNull(t *testing.T) {
|
||||
cnt, err := controller.NewSandbox("null_container",
|
||||
libnetwork.OptionHostname("test"),
|
||||
|
@ -210,7 +214,7 @@ func TestUnknownDriver(t *testing.T) {
|
|||
t.Fatal("Expected to fail. But instead succeeded")
|
||||
}
|
||||
|
||||
if !errdefs.IsNotFound(err) {
|
||||
if !isNotFound(err) {
|
||||
t.Fatalf("Did not fail with expected error. Actual error: %v", err)
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +226,7 @@ func TestNilRemoteDriver(t *testing.T) {
|
|||
t.Fatal("Expected to fail. But instead succeeded")
|
||||
}
|
||||
|
||||
if !errdefs.IsNotFound(err) {
|
||||
if !isNotFound(err) {
|
||||
t.Fatalf("Did not fail with expected error. Actual error: %v", err)
|
||||
}
|
||||
}
|
||||
|
@ -1405,7 +1409,7 @@ func TestValidRemoteDriver(t *testing.T) {
|
|||
libnetwork.NetworkOptionGeneric(getEmptyGenericOption()))
|
||||
if err != nil {
|
||||
// Only fail if we could not find the plugin driver
|
||||
if errdefs.IsNotFound(err) {
|
||||
if isNotFound(err) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue