fix TestInvalidRemoteDriver() to check underlying error
commit b1a3fe4934
changed how the error was
returned (which is now wrapped), causing the test to fail:
=== RUN TestInvalidRemoteDriver
libnetwork_test.go:1289: Did not fail with expected error. Actual error: Plugin does not implement the requested driver: plugin="invalid-network-driver", requested implementation="NetworkDriver"
--- FAIL: TestInvalidRemoteDriver (0.01s)
Changing the test to use errors.Is()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
4283e93e64
commit
eadf839530
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
package libnetwork_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -1285,7 +1286,7 @@ func TestInvalidRemoteDriver(t *testing.T) {
|
|||
t.Fatal("Expected to fail. But instead succeeded")
|
||||
}
|
||||
|
||||
if err != plugins.ErrNotImplements {
|
||||
if !errors.Is(err, plugins.ErrNotImplements) {
|
||||
t.Fatalf("Did not fail with expected error. Actual error: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue