MCPcopy Create free account
hub / github.com/compose-spec/compose-go / TestConvertWithEnvVar

Function TestConvertWithEnvVar

cli/options_windows_test.go:27–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestConvertWithEnvVar(t *testing.T) {
28 os.Setenv("COMPOSE_CONVERT_WINDOWS_PATHS", "1")
29 defer os.Unsetenv("COMPOSE_CONVERT_WINDOWS_PATHS")
30 opts, _ := NewProjectOptions([]string{"testdata/simple/compose-with-paths.yaml"},
31 WithOsEnv,
32 WithWorkingDirectory("C:\\project-dir\\"),
33 WithResolvedPaths(true))
34
35 p, err := ProjectFromOptions(context.TODO(), opts)
36
37 assert.NilError(t, err)
38 volumes := p.Services["test"].Volumes
39 assert.Equal(t, len(volumes), 3)
40 assert.Equal(t, volumes[0].Source, "/c/docker/project")
41 assert.Equal(t, volumes[1].Source, "/c/project-dir/relative")
42 assert.Equal(t, volumes[2].Source, "/c/project-dir/relative2")
43}

Callers

nothing calls this directly

Calls 4

NewProjectOptionsFunction · 0.85
WithWorkingDirectoryFunction · 0.85
WithResolvedPathsFunction · 0.85
ProjectFromOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…