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

Function TestMountOptSourceTargetAliases

opts/mount_test.go:78–98  ·  view source on GitHub ↗

TestMountOptSourceTargetAliases tests several aliases that should have the same result.

(t *testing.T)

Source from the content-addressed store, hash-verified

76// TestMountOptSourceTargetAliases tests several aliases that should have
77// the same result.
78func TestMountOptSourceTargetAliases(t *testing.T) {
79 for _, tc := range []string{
80 "type=bind,src=/source,dst=/target",
81 "type=bind,source=/source,target=/target",
82 "type=bind,source=/source,destination=/target",
83 } {
84 t.Run(tc, func(t *testing.T) {
85 var m MountOpt
86
87 assert.NilError(t, m.Set(tc))
88
89 mounts := m.Value()
90 assert.Assert(t, is.Len(mounts, 1))
91 assert.Check(t, is.DeepEqual(mount.Mount{
92 Type: mount.TypeBind,
93 Source: "/source",
94 Target: "/target",
95 }, mounts[0]))
96 })
97 }
98}
99
100// TestMountOptDefaultType ensures that a mount without the type defaults to a
101// volume mount.

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…