MCPcopy
hub / github.com/moby/moby / TestPluginPushError

Function TestPluginPushError

client/plugin_push_test.go:14–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestPluginPushError(t *testing.T) {
15 client, err := New(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
16 assert.NilError(t, err)
17
18 _, err = client.PluginPush(t.Context(), "plugin_name", PluginPushOptions{})
19 assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
20
21 _, err = client.PluginPush(t.Context(), "", PluginPushOptions{})
22 assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
23 assert.Check(t, is.ErrorContains(err, "value is empty"))
24
25 _, err = client.PluginPush(t.Context(), " ", PluginPushOptions{})
26 assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
27 assert.Check(t, is.ErrorContains(err, "value is empty"))
28}
29
30func TestPluginPush(t *testing.T) {
31 const expectedURL = "/plugins/plugin_name"

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…