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

Function TestCheckpointListWithOptions

cli/command/checkpoint/list_test.go:51–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestCheckpointListWithOptions(t *testing.T) {
52 var containerID, checkpointDir string
53 cli := test.NewFakeCli(&fakeClient{
54 checkpointListFunc: func(container string, options client.CheckpointListOptions) (client.CheckpointListResult, error) {
55 containerID = container
56 checkpointDir = options.CheckpointDir
57 return client.CheckpointListResult{
58 Items: []checkpoint.Summary{
59 {Name: "checkpoint-foo"},
60 },
61 }, nil
62 },
63 })
64 cmd := newListCommand(cli)
65 cmd.SetArgs([]string{"container-foo"})
66 assert.Check(t, cmd.Flags().Set("checkpoint-dir", "/dir/foo"))
67 assert.NilError(t, cmd.Execute())
68 assert.Check(t, is.Equal("container-foo", containerID))
69 assert.Check(t, is.Equal("/dir/foo", checkpointDir))
70 golden.Assert(t, cli.OutBuffer().String(), "checkpoint-list-with-options.golden")
71}

Callers

nothing calls this directly

Calls 5

OutBufferMethod · 0.95
SetArgsMethod · 0.80
newListCommandFunction · 0.70
StringMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…