diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2023-05-10 13:17:40 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2023-05-10 22:13:38 +0200 |
commit | 66ff1e063eac6626658bafaa034a2ef9af9ad290 (patch) | |
tree | 5227ebde88a0dda06da4a2d5d1f66bd2612d274a /client/image_import_test.go | |
parent | 685b3d820a7f10d1d0b6e90a19f1ba0cf5c2caa2 (diff) | |
download | docker-66ff1e063eac6626658bafaa034a2ef9af9ad290.tar.gz |
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>
Diffstat (limited to 'client/image_import_test.go')
-rw-r--r-- | client/image_import_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/image_import_test.go b/client/image_import_test.go index 34f1e0642f..abc381f652 100644 --- a/client/image_import_test.go +++ b/client/image_import_test.go @@ -12,6 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/errdefs" + "gotest.tools/v3/assert" + is "gotest.tools/v3/assert/cmp" ) func TestImageImportError(t *testing.T) { @@ -19,9 +21,7 @@ func TestImageImportError(t *testing.T) { client: newMockClient(errorMock(http.StatusInternalServerError, "Server error")), } _, err := client.ImageImport(context.Background(), types.ImageImportSource{}, "image:tag", types.ImageImportOptions{}) - 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 TestImageImport(t *testing.T) { |