(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestUpdateMounts(t *testing.T) { |
| 238 | flags := newUpdateCommand(nil).Flags() |
| 239 | flags.Set("mount-add", "type=volume,source=vol2,target=/toadd") |
| 240 | flags.Set("mount-rm", "/toremove") |
| 241 | |
| 242 | mounts := []mount.Mount{ |
| 243 | {Target: "/toremove", Source: "vol1", Type: mount.TypeBind}, |
| 244 | {Target: "/tokeep", Source: "vol3", Type: mount.TypeBind}, |
| 245 | } |
| 246 | |
| 247 | updateMounts(flags, &mounts) |
| 248 | assert.Assert(t, is.Len(mounts, 2)) |
| 249 | assert.Check(t, is.Equal("/toadd", mounts[0].Target)) |
| 250 | assert.Check(t, is.Equal("/tokeep", mounts[1].Target)) |
| 251 | } |
| 252 | |
| 253 | func TestUpdateMountsWithDuplicateMounts(t *testing.T) { |
| 254 | flags := newUpdateCommand(nil).Flags() |
nothing calls this directly
no test coverage detected
searching dependent graphs…