(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…