commit b1a3fe49341bec714c1017067bd17d9052e5a2d6 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>
| ... | ... |
@@ -4,6 +4,7 @@ |
| 4 | 4 |
package libnetwork_test |
| 5 | 5 |
|
| 6 | 6 |
import ( |
| 7 |
+ "errors" |
|
| 7 | 8 |
"fmt" |
| 8 | 9 |
"net" |
| 9 | 10 |
"net/http" |
| ... | ... |
@@ -1285,7 +1286,7 @@ func TestInvalidRemoteDriver(t *testing.T) {
|
| 1285 | 1285 |
t.Fatal("Expected to fail. But instead succeeded")
|
| 1286 | 1286 |
} |
| 1287 | 1287 |
|
| 1288 |
- if err != plugins.ErrNotImplements {
|
|
| 1288 |
+ if !errors.Is(err, plugins.ErrNotImplements) {
|
|
| 1289 | 1289 |
t.Fatalf("Did not fail with expected error. Actual error: %v", err)
|
| 1290 | 1290 |
} |
| 1291 | 1291 |
} |