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

Function TestUpdateDescriptionOnly

cli/command/context/update_test.go:12–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestUpdateDescriptionOnly(t *testing.T) {
13 cli := makeFakeCli(t)
14 err := runCreate(cli, "test", createOptions{
15 endpoint: map[string]string{},
16 })
17 assert.NilError(t, err)
18 cli.OutBuffer().Reset()
19 cli.ErrBuffer().Reset()
20 assert.NilError(t, runUpdate(cli, "test", updateOptions{
21 description: "description",
22 }))
23 c, err := cli.ContextStore().GetMetadata("test")
24 assert.NilError(t, err)
25 dc, err := command.GetDockerContext(c)
26 assert.NilError(t, err)
27 assert.Equal(t, dc.Description, "description")
28
29 assert.Equal(t, "test\n", cli.OutBuffer().String())
30 assert.Equal(t, "Successfully updated context \"test\"\n", cli.ErrBuffer().String())
31}
32
33func TestUpdateDockerOnly(t *testing.T) {
34 cli := makeFakeCli(t)

Callers

nothing calls this directly

Calls 8

makeFakeCliFunction · 0.85
runCreateFunction · 0.70
runUpdateFunction · 0.70
GetMetadataMethod · 0.65
ContextStoreMethod · 0.65
StringMethod · 0.65
OutBufferMethod · 0.45
ErrBufferMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…