(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestNodeDemoteMultipleNode(t *testing.T) { |
| 73 | cmd := newDemoteCommand( |
| 74 | test.NewFakeCli(&fakeClient{ |
| 75 | nodeInspectFunc: func() (client.NodeInspectResult, error) { |
| 76 | return client.NodeInspectResult{ |
| 77 | Node: *builders.Node(builders.Manager()), |
| 78 | }, nil |
| 79 | }, |
| 80 | nodeUpdateFunc: func(nodeID string, options client.NodeUpdateOptions) (client.NodeUpdateResult, error) { |
| 81 | if options.Spec.Role != swarm.NodeRoleWorker { |
| 82 | return client.NodeUpdateResult{}, errors.New("expected role worker, got " + string(options.Spec.Role)) |
| 83 | } |
| 84 | return client.NodeUpdateResult{}, nil |
| 85 | }, |
| 86 | })) |
| 87 | cmd.SetArgs([]string{"nodeID1", "nodeID2"}) |
| 88 | assert.NilError(t, cmd.Execute()) |
| 89 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…