MCPcopy
hub / github.com/moby/moby / TestConfigUpdateError

Function TestConfigUpdateError

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

Source from the content-addressed store, hash-verified

10)
11
12func TestConfigUpdateError(t *testing.T) {
13 client, err := New(
14 WithMockClient(errorMock(http.StatusInternalServerError, "Server error")),
15 )
16 assert.NilError(t, err)
17
18 _, err = client.ConfigUpdate(t.Context(), "config_id", ConfigUpdateOptions{})
19 assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
20
21 _, err = client.ConfigUpdate(t.Context(), "", ConfigUpdateOptions{})
22 assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
23 assert.Check(t, is.ErrorContains(err, "value is empty"))
24
25 _, err = client.ConfigUpdate(t.Context(), " ", ConfigUpdateOptions{})
26 assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
27 assert.Check(t, is.ErrorContains(err, "value is empty"))
28}
29
30func TestConfigUpdate(t *testing.T) {
31 const expectedURL = "/configs/config_id/update"

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…