summaryrefslogtreecommitdiff
path: root/integration/image
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2018-05-21 00:06:50 +0200
committerSebastiaan van Stijn <github@gone.nl>2018-05-21 00:13:04 +0200
commit55bebbaecf5e40db9d83b28080ce08dc8642f407 (patch)
tree0676eb2e78bce6215d2dfff67635222a3c54a95b /integration/image
parentf9dd74deee364dd513615ea112e78008a946b3e5 (diff)
downloaddocker-55bebbaecf5e40db9d83b28080ce08dc8642f407.tar.gz
Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'integration/image')
-rw-r--r--integration/image/remove_test.go3
-rw-r--r--integration/image/tag_test.go17
2 files changed, 10 insertions, 10 deletions
diff --git a/integration/image/remove_test.go b/integration/image/remove_test.go
index 5ad09d51e0..172c27f54d 100644
--- a/integration/image/remove_test.go
+++ b/integration/image/remove_test.go
@@ -7,7 +7,6 @@ import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/integration/internal/container"
"github.com/docker/docker/internal/test/request"
- "github.com/docker/docker/internal/testutil"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
@@ -56,5 +55,5 @@ func TestRemoveImageOrphaning(t *testing.T) {
// check if the second image has been deleted
_, _, err = client.ImageInspectWithRaw(ctx, commitResp2.ID)
- testutil.ErrorContains(t, err, "No such image:")
+ assert.Check(t, is.ErrorContains(err, "No such image:"))
}
diff --git a/integration/image/tag_test.go b/integration/image/tag_test.go
index e009114250..06431cd8a2 100644
--- a/integration/image/tag_test.go
+++ b/integration/image/tag_test.go
@@ -39,7 +39,7 @@ func TestTagInvalidReference(t *testing.T) {
for _, repo := range invalidRepos {
err := client.ImageTag(ctx, "busybox", repo)
- testutil.ErrorContains(t, err, "not a valid repository/tag")
+ assert.Check(t, is.ErrorContains(err, "not a valid repository/tag"))
}
longTag := testutil.GenerateRandomAlphaOnlyString(121)
@@ -48,24 +48,24 @@ func TestTagInvalidReference(t *testing.T) {
for _, repotag := range invalidTags {
err := client.ImageTag(ctx, "busybox", repotag)
- testutil.ErrorContains(t, err, "not a valid repository/tag")
+ assert.Check(t, is.ErrorContains(err, "not a valid repository/tag"))
}
// test repository name begin with '-'
err := client.ImageTag(ctx, "busybox:latest", "-busybox:test")
- testutil.ErrorContains(t, err, "Error parsing reference")
+ assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
// test namespace name begin with '-'
err = client.ImageTag(ctx, "busybox:latest", "-test/busybox:test")
- testutil.ErrorContains(t, err, "Error parsing reference")
+ assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
// test index name begin with '-'
err = client.ImageTag(ctx, "busybox:latest", "-index:5000/busybox:test")
- testutil.ErrorContains(t, err, "Error parsing reference")
+ assert.Check(t, is.ErrorContains(err, "Error parsing reference"))
// test setting tag fails
err = client.ImageTag(ctx, "busybox:latest", "sha256:sometag")
- testutil.ErrorContains(t, err, "refusing to create an ambiguous tag using digest algorithm as name")
+ assert.Check(t, is.ErrorContains(err, "refusing to create an ambiguous tag using digest algorithm as name"))
}
// ensure we allow the use of valid tags
@@ -132,8 +132,9 @@ func TestTagMatchesDigest(t *testing.T) {
digest := "busybox@sha256:abcdef76720241213f5303bda7704ec4c2ef75613173910a56fb1b6e20251507"
// test setting tag fails
err := client.ImageTag(ctx, "busybox:latest", digest)
- testutil.ErrorContains(t, err, "refusing to create a tag with a digest reference")
+ assert.Check(t, is.ErrorContains(err, "refusing to create a tag with a digest reference"))
+
// check that no new image matches the digest
_, _, err = client.ImageInspectWithRaw(ctx, digest)
- testutil.ErrorContains(t, err, fmt.Sprintf("No such image: %s", digest))
+ assert.Check(t, is.ErrorContains(err, fmt.Sprintf("No such image: %s", digest)))
}