Browse code

integration/image: TestRemoveByDigest fixed unused values (wastedassign)

Add some assertions, and removed a log, instead using it as message
if the assertion fails.

integration/image/remove_test.go:88:2: assigned to inspect, but reassigned without using the value (wastedassign)
inspect, err = client.ImageInspect(ctx, "busybox")
^
integration/image/remove_test.go:91:2: assigned to inspect, but never used afterwards (wastedassign)
inspect, err = client.ImageInspect(ctx, "test-remove-by-digest")
^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2025/02/08 07:43:15
Showing 1 changed files
... ...
@@ -81,13 +81,13 @@ func TestRemoveByDigest(t *testing.T) {
81 81
 	}
82 82
 	assert.Assert(t, id != "")
83 83
 
84
-	t.Logf("removing %s", id)
85 84
 	_, err = client.ImageRemove(ctx, id, image.RemoveOptions{})
86
-	assert.NilError(t, err)
85
+	assert.NilError(t, err, "error reemoving %s", id)
87 86
 
88
-	inspect, err = client.ImageInspect(ctx, "busybox")
89
-	assert.Check(t, err, "busybox image got deleted")
87
+	_, err = client.ImageInspect(ctx, "busybox")
88
+	assert.NilError(t, err, "busybox image got deleted")
90 89
 
91 90
 	inspect, err = client.ImageInspect(ctx, "test-remove-by-digest")
92 91
 	assert.Check(t, is.ErrorType(err, errdefs.IsNotFound))
92
+	assert.Check(t, is.DeepEqual(inspect, image.InspectResponse{}))
93 93
 }