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

Function TestMountOptSetImageNoError

opts/mount_test.go:431–450  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

429}
430
431func TestMountOptSetImageNoError(t *testing.T) {
432 for _, tc := range []string{
433 "type=image,source=foo,target=/target,image-subpath=/bar",
434 } {
435 var m MountOpt
436
437 assert.NilError(t, m.Set(tc))
438
439 mounts := m.Value()
440 assert.Assert(t, is.Len(mounts, 1))
441 assert.Check(t, is.DeepEqual(mount.Mount{
442 Type: mount.TypeImage,
443 Source: "foo",
444 Target: "/target",
445 ImageOptions: &mount.ImageOptions{
446 Subpath: "/bar",
447 },
448 }, mounts[0]))
449 }
450}
451
452// TestMountOptSetTmpfsNoError tests several aliases that should have
453// the same result.

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
ValueMethod · 0.95
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…