MCPcopy
hub / github.com/moby/moby / TestImagePushStatusUnauthorizedError

Function TestImagePushStatusUnauthorizedError

client/image_push_test.go:37–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestImagePushStatusUnauthorizedError(t *testing.T) {
38 client, err := New(WithMockClient(errorMock(http.StatusUnauthorized, "Unauthorized error")))
39 assert.NilError(t, err)
40 _, err = client.ImagePush(t.Context(), "myimage", ImagePushOptions{})
41 assert.Check(t, is.ErrorType(err, cerrdefs.IsUnauthorized))
42}
43
44func TestImagePushWithUnauthorizedErrorAndPrivilegeFuncError(t *testing.T) {
45 client, err := New(WithMockClient(errorMock(http.StatusUnauthorized, "Unauthorized error")))

Callers

nothing calls this directly

Calls 6

WithMockClientFunction · 0.85
errorMockFunction · 0.85
CheckMethod · 0.80
NewFunction · 0.70
ImagePushMethod · 0.65
ContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…