66 "testing"
77
88 "github.com/docker/cli/internal/test"
9- "github.com/docker/docker/api/types"
9+ "github.com/docker/docker/api/types/checkpoint "
1010 "github.com/pkg/errors"
1111 "gotest.tools/v3/assert"
1212 is "gotest.tools/v3/assert/cmp"
@@ -15,7 +15,7 @@ import (
1515func TestCheckpointCreateErrors (t * testing.T ) {
1616 testCases := []struct {
1717 args []string
18- checkpointCreateFunc func (container string , options types. CheckpointCreateOptions ) error
18+ checkpointCreateFunc func (container string , options checkpoint. CreateOptions ) error
1919 expectedError string
2020 }{
2121 {
@@ -28,7 +28,7 @@ func TestCheckpointCreateErrors(t *testing.T) {
2828 },
2929 {
3030 args : []string {"foo" , "bar" },
31- checkpointCreateFunc : func (container string , options types. CheckpointCreateOptions ) error {
31+ checkpointCreateFunc : func (container string , options checkpoint. CreateOptions ) error {
3232 return errors .Errorf ("error creating checkpoint for container foo" )
3333 },
3434 expectedError : "error creating checkpoint for container foo" ,
@@ -50,7 +50,7 @@ func TestCheckpointCreateWithOptions(t *testing.T) {
5050 var containerID , checkpointID , checkpointDir string
5151 var exit bool
5252 cli := test .NewFakeCli (& fakeClient {
53- checkpointCreateFunc : func (container string , options types. CheckpointCreateOptions ) error {
53+ checkpointCreateFunc : func (container string , options checkpoint. CreateOptions ) error {
5454 containerID = container
5555 checkpointID = options .CheckpointID
5656 checkpointDir = options .CheckpointDir
@@ -59,14 +59,14 @@ func TestCheckpointCreateWithOptions(t *testing.T) {
5959 },
6060 })
6161 cmd := newCreateCommand (cli )
62- checkpoint := "checkpoint-bar"
63- cmd .SetArgs ([]string {"container-foo" , checkpoint })
62+ cp := "checkpoint-bar"
63+ cmd .SetArgs ([]string {"container-foo" , cp })
6464 cmd .Flags ().Set ("leave-running" , "true" )
6565 cmd .Flags ().Set ("checkpoint-dir" , "/dir/foo" )
6666 assert .NilError (t , cmd .Execute ())
6767 assert .Check (t , is .Equal ("container-foo" , containerID ))
68- assert .Check (t , is .Equal (checkpoint , checkpointID ))
68+ assert .Check (t , is .Equal (cp , checkpointID ))
6969 assert .Check (t , is .Equal ("/dir/foo" , checkpointDir ))
7070 assert .Check (t , is .Equal (false , exit ))
71- assert .Check (t , is .Equal (checkpoint , strings .TrimSpace (cli .OutBuffer ().String ())))
71+ assert .Check (t , is .Equal (cp , strings .TrimSpace (cli .OutBuffer ().String ())))
7272}
0 commit comments