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

Function TestGetConfigDetails

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

Source from the content-addressed store, hash-verified

13)
14
15func TestGetConfigDetails(t *testing.T) {
16 content := `
17version: "3.0"
18services:
19 foo:
20 image: alpine:3.5
21`
22 file := fs.NewFile(t, "test-get-config-details", fs.WithContent(content))
23 defer file.Remove()
24
25 details, err := getConfigDetails([]string{file.Path()}, nil)
26 assert.NilError(t, err)
27 assert.Check(t, is.Equal(filepath.Dir(file.Path()), details.WorkingDir))
28 assert.Assert(t, is.Len(details.ConfigFiles, 1))
29 assert.Check(t, is.Equal("3.0", details.ConfigFiles[0].Config["version"]))
30 assert.Check(t, is.Len(details.Environment, len(os.Environ())))
31}
32
33func TestGetConfigDetailsStdin(t *testing.T) {
34 content := `

Callers

nothing calls this directly

Calls 4

getConfigDetailsFunction · 0.85
RemoveMethod · 0.65
PathMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…