client: update error-assertions in tests

- use is.ErrorType
- replace uses of client.IsErrNotFound for errdefs.IsNotFound, as
  the client no longer returns the old error-type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-05-10 13:17:40 +02:00
parent 685b3d820a
commit 66ff1e063e
93 changed files with 282 additions and 392 deletions

View File

@@ -11,6 +11,8 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/errdefs"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
func TestPluginRemoveError(t *testing.T) {
@@ -19,9 +21,7 @@ func TestPluginRemoveError(t *testing.T) {
}
err := client.PluginRemove(context.Background(), "plugin_name", types.PluginRemoveOptions{})
if !errdefs.IsSystem(err) {
t.Fatalf("expected a Server Error, got %[1]T: %[1]v", err)
}
assert.Check(t, is.ErrorType(err, errdefs.IsSystem))
}
func TestPluginRemove(t *testing.T) {