(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestUpdatePlacementConstraints(t *testing.T) { |
| 94 | flags := newUpdateCommand(nil).Flags() |
| 95 | flags.Set("constraint-add", "node=toadd") |
| 96 | flags.Set("constraint-rm", "node!=toremove") |
| 97 | |
| 98 | placement := &swarm.Placement{ |
| 99 | Constraints: []string{"node!=toremove", "container=tokeep"}, |
| 100 | } |
| 101 | |
| 102 | updatePlacementConstraints(flags, placement) |
| 103 | assert.Assert(t, is.Len(placement.Constraints, 2)) |
| 104 | assert.Check(t, is.Equal("container=tokeep", placement.Constraints[0])) |
| 105 | assert.Check(t, is.Equal("node=toadd", placement.Constraints[1])) |
| 106 | } |
| 107 | |
| 108 | func TestUpdatePlacementPrefs(t *testing.T) { |
| 109 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…