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

Function TestGetConfigDetailsStdin

cli/command/stack/loader_test.go:33–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestGetConfigDetailsStdin(t *testing.T) {
34 content := `
35version: "3.0"
36services:
37 foo:
38 image: alpine:3.5
39`
40 details, err := getConfigDetails([]string{"-"}, strings.NewReader(content))
41 assert.NilError(t, err)
42 cwd, err := os.Getwd()
43 assert.NilError(t, err)
44 assert.Check(t, is.Equal(cwd, details.WorkingDir))
45 assert.Assert(t, is.Len(details.ConfigFiles, 1))
46 assert.Check(t, is.Equal("3.0", details.ConfigFiles[0].Config["version"]))
47 assert.Check(t, is.Len(details.Environment, len(os.Environ())))
48}
49
50func TestBuildEnvironment(t *testing.T) {
51 inputEnv := []string{

Callers

nothing calls this directly

Calls 2

getConfigDetailsFunction · 0.85
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…