MCPcopy
hub / github.com/docker/compose / TestBuildVolumeMount

Function TestBuildVolumeMount

pkg/compose/create_test.go:68–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestBuildVolumeMount(t *testing.T) {
69 project := composetypes.Project{
70 Name: "myProject",
71 Volumes: composetypes.Volumes(map[string]composetypes.VolumeConfig{
72 "myVolume": {
73 Name: "myProject_myVolume",
74 },
75 }),
76 }
77 volume := composetypes.ServiceVolumeConfig{
78 Type: composetypes.VolumeTypeVolume,
79 Source: "myVolume",
80 Target: "/data",
81 }
82 mount, err := buildMount(project, volume)
83 assert.NilError(t, err)
84 assert.Equal(t, mount.Source, "myProject_myVolume")
85 assert.Equal(t, mount.Type, mountTypes.TypeVolume)
86}
87
88func TestServiceImageName(t *testing.T) {
89 assert.Equal(t, api.GetImageNameOrDefault(composetypes.ServiceConfig{Image: "myImage"}, "myProject"), "myImage")

Callers

nothing calls this directly

Calls 2

buildMountFunction · 0.85
VolumesMethod · 0.65

Tested by

no test coverage detected