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

Function TestCheckpointRemoveWithOptions

cli/command/checkpoint/remove_test.go:49–66  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestCheckpointRemoveWithOptions(t *testing.T) {
50 var containerID, checkpointID, checkpointDir string
51 cli := test.NewFakeCli(&fakeClient{
52 checkpointDeleteFunc: func(container string, options client.CheckpointRemoveOptions) (client.CheckpointRemoveResult, error) {
53 containerID = container
54 checkpointID = options.CheckpointID
55 checkpointDir = options.CheckpointDir
56 return client.CheckpointRemoveResult{}, nil
57 },
58 })
59 cmd := newRemoveCommand(cli)
60 cmd.SetArgs([]string{"container-foo", "checkpoint-bar"})
61 assert.Check(t, cmd.Flags().Set("checkpoint-dir", "/dir/foo"))
62 assert.NilError(t, cmd.Execute())
63 assert.Check(t, is.Equal("container-foo", containerID))
64 assert.Check(t, is.Equal("checkpoint-bar", checkpointID))
65 assert.Check(t, is.Equal("/dir/foo", checkpointDir))
66}

Callers

nothing calls this directly

Calls 3

SetArgsMethod · 0.80
newRemoveCommandFunction · 0.70
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…