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

Function TestConfig

e2e/cli-plugins/config_test.go:12–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestConfig(t *testing.T) {
13 run, cfg, cleanup := prepare(t)
14 defer cleanup()
15
16 cfg.SetPluginConfig("helloworld", "who", "Cambridge")
17 err := cfg.Save()
18 assert.NilError(t, err)
19
20 res := icmd.RunCmd(run("helloworld"))
21 res.Assert(t, icmd.Expected{
22 ExitCode: 0,
23 Out: "Hello Cambridge",
24 })
25
26 cfg2, err := config.Load(filepath.Dir(cfg.GetFilename()))
27 assert.NilError(t, err)
28 assert.DeepEqual(t, cfg2.Plugins, map[string]map[string]string{
29 "helloworld": {
30 "who": "Cambridge",
31 "lastwho": "Cambridge",
32 },
33 })
34}

Callers

nothing calls this directly

Calls 5

prepareFunction · 0.85
SetPluginConfigMethod · 0.80
SaveMethod · 0.65
GetFilenameMethod · 0.65
runFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…