MCPcopy Index your code
hub / github.com/docker/cli / TestNodePromoteNoChange

Function TestNodePromoteNoChange

cli/command/node/promote_test.go:53–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestNodePromoteNoChange(t *testing.T) {
54 cmd := newPromoteCommand(
55 test.NewFakeCli(&fakeClient{
56 nodeInspectFunc: func() (client.NodeInspectResult, error) {
57 return client.NodeInspectResult{
58 Node: *builders.Node(builders.Manager()),
59 }, nil
60 },
61 nodeUpdateFunc: func(nodeID string, options client.NodeUpdateOptions) (client.NodeUpdateResult, error) {
62 if options.Spec.Role != swarm.NodeRoleManager {
63 return client.NodeUpdateResult{}, errors.New("expected role manager, got" + string(options.Spec.Role))
64 }
65 return client.NodeUpdateResult{}, nil
66 },
67 }))
68 cmd.SetArgs([]string{"nodeID"})
69 assert.NilError(t, cmd.Execute())
70}
71
72func TestNodePromoteMultipleNode(t *testing.T) {
73 cmd := newPromoteCommand(

Callers

nothing calls this directly

Calls 3

newPromoteCommandFunction · 0.85
NodeMethod · 0.80
SetArgsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…