MCPcopy
hub / github.com/moby/moby / TestImagePushAnyError

Function TestImagePushAnyError

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

Source from the content-addressed store, hash-verified

28}
29
30func TestImagePushAnyError(t *testing.T) {
31 client, err := New(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
32 assert.NilError(t, err)
33 _, err = client.ImagePush(t.Context(), "myimage", ImagePushOptions{})
34 assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
35}
36
37func TestImagePushStatusUnauthorizedError(t *testing.T) {
38 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…