MCPcopy Create free account
hub / github.com/docker/cli / TestUpdateMountsWithDuplicateMounts

Function TestUpdateMountsWithDuplicateMounts

cli/command/service/update_test.go:253–268  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

251}
252
253func TestUpdateMountsWithDuplicateMounts(t *testing.T) {
254 flags := newUpdateCommand(nil).Flags()
255 flags.Set("mount-add", "type=volume,source=vol4,target=/toadd")
256
257 mounts := []mount.Mount{
258 {Target: "/tokeep1", Source: "vol1", Type: mount.TypeBind},
259 {Target: "/toadd", Source: "vol2", Type: mount.TypeBind},
260 {Target: "/tokeep2", Source: "vol3", Type: mount.TypeBind},
261 }
262
263 updateMounts(flags, &mounts)
264 assert.Assert(t, is.Len(mounts, 3))
265 assert.Check(t, is.Equal("/tokeep1", mounts[0].Target))
266 assert.Check(t, is.Equal("/tokeep2", mounts[1].Target))
267 assert.Check(t, is.Equal("/toadd", mounts[2].Target))
268}
269
270func TestUpdatePorts(t *testing.T) {
271 flags := newUpdateCommand(nil).Flags()

Callers

nothing calls this directly

Calls 4

updateMountsFunction · 0.85
newUpdateCommandFunction · 0.70
SetMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…