From b3f843afe29e3fbdc19c99f50ca6261878179d53 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 21 Aug 2017 16:30:09 -0400 Subject: [PATCH] Move internal/test package out of cli. Signed-off-by: Daniel Nephin --- cli/command/checkpoint/create_test.go | 2 +- cli/command/checkpoint/list_test.go | 2 +- cli/command/checkpoint/remove_test.go | 2 +- cli/command/config/create_test.go | 2 +- cli/command/config/inspect_test.go | 4 ++-- cli/command/config/ls_test.go | 4 ++-- cli/command/config/remove_test.go | 2 +- cli/command/container/attach_test.go | 2 +- cli/command/container/exec_test.go | 2 +- cli/command/idresolver/idresolver_test.go | 2 +- cli/command/image/build_test.go | 2 +- cli/command/image/history_test.go | 2 +- cli/command/image/import_test.go | 2 +- cli/command/image/inspect_test.go | 2 +- cli/command/image/list_test.go | 2 +- cli/command/image/load_test.go | 2 +- cli/command/image/prune_test.go | 2 +- cli/command/image/pull_test.go | 2 +- cli/command/image/push_test.go | 2 +- cli/command/image/remove_test.go | 2 +- cli/command/image/save_test.go | 2 +- cli/command/image/tag_test.go | 2 +- cli/command/network/connect_test.go | 2 +- cli/command/network/create_test.go | 2 +- cli/command/network/disconnect_test.go | 2 +- cli/command/node/demote_test.go | 4 ++-- cli/command/node/inspect_test.go | 4 ++-- cli/command/node/list_test.go | 4 ++-- cli/command/node/promote_test.go | 4 ++-- cli/command/node/ps_test.go | 4 ++-- cli/command/node/remove_test.go | 2 +- cli/command/node/update_test.go | 4 ++-- cli/command/registry_test.go | 4 ++-- cli/command/secret/create_test.go | 2 +- cli/command/secret/inspect_test.go | 4 ++-- cli/command/secret/ls_test.go | 4 ++-- cli/command/secret/remove_test.go | 2 +- cli/command/service/client_test.go | 2 +- cli/command/service/list_test.go | 2 +- cli/command/service/ps_test.go | 2 +- cli/command/service/rollback_test.go | 2 +- cli/command/stack/deploy_composefile_test.go | 2 +- cli/command/stack/deploy_test.go | 2 +- cli/command/stack/list_test.go | 4 ++-- cli/command/stack/ps_test.go | 4 ++-- cli/command/stack/remove_test.go | 2 +- cli/command/stack/services_test.go | 4 ++-- cli/command/swarm/ca_test.go | 2 +- cli/command/swarm/init_test.go | 2 +- cli/command/swarm/join_test.go | 2 +- cli/command/swarm/join_token_test.go | 4 ++-- cli/command/swarm/leave_test.go | 2 +- cli/command/swarm/unlock_key_test.go | 4 ++-- cli/command/swarm/unlock_test.go | 2 +- cli/command/swarm/update_test.go | 4 ++-- cli/command/system/prune_test.go | 2 +- cli/command/task/print_test.go | 4 ++-- cli/command/volume/create_test.go | 2 +- cli/command/volume/inspect_test.go | 4 ++-- cli/command/volume/list_test.go | 4 ++-- cli/command/volume/prune_test.go | 2 +- cli/command/volume/remove_test.go | 2 +- .../internal => internal}/test/builders/config.go | 0 {cli/internal => internal}/test/builders/doc.go | 0 {cli/internal => internal}/test/builders/node.go | 0 .../internal => internal}/test/builders/secret.go | 0 .../test/builders/service.go | 0 {cli/internal => internal}/test/builders/swarm.go | 0 {cli/internal => internal}/test/builders/task.go | 0 .../internal => internal}/test/builders/volume.go | 0 {cli/internal => internal}/test/cli.go | 0 {cli/internal => internal}/test/doc.go | 0 {cli/internal => internal}/test/network/client.go | 0 {cli/internal => internal}/test/store.go | 0 internal/test/testutil/assert.go | 15 +++++++++++++++ 75 files changed, 97 insertions(+), 82 deletions(-) rename {cli/internal => internal}/test/builders/config.go (100%) rename {cli/internal => internal}/test/builders/doc.go (100%) rename {cli/internal => internal}/test/builders/node.go (100%) rename {cli/internal => internal}/test/builders/secret.go (100%) rename {cli/internal => internal}/test/builders/service.go (100%) rename {cli/internal => internal}/test/builders/swarm.go (100%) rename {cli/internal => internal}/test/builders/task.go (100%) rename {cli/internal => internal}/test/builders/volume.go (100%) rename {cli/internal => internal}/test/cli.go (100%) rename {cli/internal => internal}/test/doc.go (100%) rename {cli/internal => internal}/test/network/client.go (100%) rename {cli/internal => internal}/test/store.go (100%) create mode 100644 internal/test/testutil/assert.go diff --git a/cli/command/checkpoint/create_test.go b/cli/command/checkpoint/create_test.go index 32c9d88a..8aae6eba 100644 --- a/cli/command/checkpoint/create_test.go +++ b/cli/command/checkpoint/create_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/checkpoint/list_test.go b/cli/command/checkpoint/list_test.go index 26dd963a..dd934cd5 100644 --- a/cli/command/checkpoint/list_test.go +++ b/cli/command/checkpoint/list_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/checkpoint/remove_test.go b/cli/command/checkpoint/remove_test.go index 976aa078..174a389e 100644 --- a/cli/command/checkpoint/remove_test.go +++ b/cli/command/checkpoint/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/config/create_test.go b/cli/command/config/create_test.go index 7a6b2f54..a5bdce2d 100644 --- a/cli/command/config/create_test.go +++ b/cli/command/config/create_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/config/inspect_test.go b/cli/command/config/inspect_test.go index 0431ffd6..320df70a 100644 --- a/cli/command/config/inspect_test.go +++ b/cli/command/config/inspect_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/config/ls_test.go b/cli/command/config/ls_test.go index f58e815a..dfe79dc3 100644 --- a/cli/command/config/ls_test.go +++ b/cli/command/config/ls_test.go @@ -6,12 +6,12 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/config/remove_test.go b/cli/command/config/remove_test.go index 28cc41f6..2b724516 100644 --- a/cli/command/config/remove_test.go +++ b/cli/command/config/remove_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/container/attach_test.go b/cli/command/container/attach_test.go index a33eeeeb..e4caa473 100644 --- a/cli/command/container/attach_test.go +++ b/cli/command/container/attach_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/container/exec_test.go b/cli/command/container/exec_test.go index 0eed2ff0..acfe250d 100644 --- a/cli/command/container/exec_test.go +++ b/cli/command/container/exec_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/idresolver/idresolver_test.go b/cli/command/idresolver/idresolver_test.go index f740c13e..98bd306d 100644 --- a/cli/command/idresolver/idresolver_test.go +++ b/cli/command/idresolver/idresolver_test.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types/swarm" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/cli/command/image/build_test.go b/cli/command/image/build_test.go index 3664b91b..325c8234 100644 --- a/cli/command/image/build_test.go +++ b/cli/command/image/build_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/archive" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/history_test.go b/cli/command/image/history_test.go index 7053735a..c0a7ef31 100644 --- a/cli/command/image/history_test.go +++ b/cli/command/image/history_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index 87cc8969..0e45e788 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/image/inspect_test.go b/cli/command/image/inspect_test.go index 0bcb6583..d1de6856 100644 --- a/cli/command/image/inspect_test.go +++ b/cli/command/image/inspect_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 58b7a71b..9be4c379 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/load_test.go b/cli/command/image/load_test.go index bebe40cb..d3002aa1 100644 --- a/cli/command/image/load_test.go +++ b/cli/command/image/load_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/prune_test.go b/cli/command/image/prune_test.go index b5260160..90845e4b 100644 --- a/cli/command/image/prune_test.go +++ b/cli/command/image/prune_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/image/pull_test.go b/cli/command/image/pull_test.go index 7b24cdbb..57cd0ac7 100644 --- a/cli/command/image/pull_test.go +++ b/cli/command/image/pull_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 1ead5b15..8f8b35d2 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index a813f8f1..7bf0434d 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/save_test.go b/cli/command/image/save_test.go index 424c2c9a..9e3ff147 100644 --- a/cli/command/image/save_test.go +++ b/cli/command/image/save_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/tag_test.go b/cli/command/image/tag_test.go index c86bd22b..bb0c71ca 100644 --- a/cli/command/image/tag_test.go +++ b/cli/command/image/tag_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/network/connect_test.go b/cli/command/network/connect_test.go index 577dd8c2..2343c7ef 100644 --- a/cli/command/network/connect_test.go +++ b/cli/command/network/connect_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/network" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/network/create_test.go b/cli/command/network/create_test.go index 76c760d0..b06febb4 100644 --- a/cli/command/network/create_test.go +++ b/cli/command/network/create_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/network/disconnect_test.go b/cli/command/network/disconnect_test.go index 9b915a19..04a5ab43 100644 --- a/cli/command/network/disconnect_test.go +++ b/cli/command/network/disconnect_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "golang.org/x/net/context" diff --git a/cli/command/node/demote_test.go b/cli/command/node/demote_test.go index d786cd47..ccdbb599 100644 --- a/cli/command/node/demote_test.go +++ b/cli/command/node/demote_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/inspect_test.go b/cli/command/node/inspect_test.go index b841b063..1ce6ebd4 100644 --- a/cli/command/node/inspect_test.go +++ b/cli/command/node/inspect_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/node/list_test.go b/cli/command/node/list_test.go index fee29e28..b3a42df4 100644 --- a/cli/command/node/list_test.go +++ b/cli/command/node/list_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/promote_test.go b/cli/command/node/promote_test.go index 2399b2ee..e0e228e8 100644 --- a/cli/command/node/promote_test.go +++ b/cli/command/node/promote_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/ps_test.go b/cli/command/node/ps_test.go index 8733e5e0..836a130f 100644 --- a/cli/command/node/ps_test.go +++ b/cli/command/node/ps_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/remove_test.go b/cli/command/node/remove_test.go index e0f3f238..84d09c70 100644 --- a/cli/command/node/remove_test.go +++ b/cli/command/node/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/node/update_test.go b/cli/command/node/update_test.go index 3abb720c..4544cd12 100644 --- a/cli/command/node/update_test.go +++ b/cli/command/node/update_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/registry_test.go b/cli/command/registry_test.go index 5e52e470..3f3d5f57 100644 --- a/cli/command/registry_test.go +++ b/cli/command/registry_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "golang.org/x/net/context" - // Prevents a circular import with "github.com/docker/cli/cli/internal/test" + // Prevents a circular import with "github.com/docker/cli/internal/test" . "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) diff --git a/cli/command/secret/create_test.go b/cli/command/secret/create_test.go index 0887601a..cc9eaa10 100644 --- a/cli/command/secret/create_test.go +++ b/cli/command/secret/create_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/secret/inspect_test.go b/cli/command/secret/inspect_test.go index eef789d8..4a38a18f 100644 --- a/cli/command/secret/inspect_test.go +++ b/cli/command/secret/inspect_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/secret/ls_test.go b/cli/command/secret/ls_test.go index cced1361..af72effe 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -7,12 +7,12 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/secret/remove_test.go b/cli/command/secret/remove_test.go index f3e427f7..51622136 100644 --- a/cli/command/secret/remove_test.go +++ b/cli/command/secret/remove_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/service/client_test.go b/cli/command/service/client_test.go index a886ff6a..ebdfe7ea 100644 --- a/cli/command/service/client_test.go +++ b/cli/command/service/client_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/client" "golang.org/x/net/context" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" ) type fakeClient struct { diff --git a/cli/command/service/list_test.go b/cli/command/service/list_test.go index 297f5f9b..679c7337 100644 --- a/cli/command/service/list_test.go +++ b/cli/command/service/list_test.go @@ -3,7 +3,7 @@ package service import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/service/ps_test.go b/cli/command/service/ps_test.go index 083c58f9..1913202d 100644 --- a/cli/command/service/ps_test.go +++ b/cli/command/service/ps_test.go @@ -3,7 +3,7 @@ package service import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/cli/opts" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" diff --git a/cli/command/service/rollback_test.go b/cli/command/service/rollback_test.go index 48be5076..f4183dae 100644 --- a/cli/command/service/rollback_test.go +++ b/cli/command/service/rollback_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/deploy_composefile_test.go b/cli/command/stack/deploy_composefile_test.go index 8d09ab05..28edb2c1 100644 --- a/cli/command/stack/deploy_composefile_test.go +++ b/cli/command/stack/deploy_composefile_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/internal/test/network" + "github.com/docker/cli/internal/test/network" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/fs" diff --git a/cli/command/stack/deploy_test.go b/cli/command/stack/deploy_test.go index f91a825f..f10fecd1 100644 --- a/cli/command/stack/deploy_test.go +++ b/cli/command/stack/deploy_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/docker/cli/cli/compose/convert" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/stretchr/testify/assert" diff --git a/cli/command/stack/list_test.go b/cli/command/stack/list_test.go index 0ae5bc78..f194d04f 100644 --- a/cli/command/stack/list_test.go +++ b/cli/command/stack/list_test.go @@ -4,9 +4,9 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/ps_test.go b/cli/command/stack/ps_test.go index 249e1b65..b98c445f 100644 --- a/cli/command/stack/ps_test.go +++ b/cli/command/stack/ps_test.go @@ -6,9 +6,9 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/remove_test.go b/cli/command/stack/remove_test.go index 88ad8a07..c44977c0 100644 --- a/cli/command/stack/remove_test.go +++ b/cli/command/stack/remove_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/stack/services_test.go b/cli/command/stack/services_test.go index fcc82ec8..d1d6c240 100644 --- a/cli/command/stack/services_test.go +++ b/cli/command/stack/services_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index a1a77d59..1271da12 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/init_test.go b/cli/command/swarm/init_test.go index 5991c3dd..24a1b907 100644 --- a/cli/command/swarm/init_test.go +++ b/cli/command/swarm/init_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/swarm/join_test.go b/cli/command/swarm/join_test.go index d9f5215b..ed8eff85 100644 --- a/cli/command/swarm/join_test.go +++ b/cli/command/swarm/join_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/join_token_test.go b/cli/command/swarm/join_token_test.go index da1b7953..89f7ab22 100644 --- a/cli/command/swarm/join_token_test.go +++ b/cli/command/swarm/join_token_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/leave_test.go b/cli/command/swarm/leave_test.go index b5b672fe..d2f5d57b 100644 --- a/cli/command/swarm/leave_test.go +++ b/cli/command/swarm/leave_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/unlock_key_test.go b/cli/command/swarm/unlock_key_test.go index 0dc9fb5f..e377e80c 100644 --- a/cli/command/swarm/unlock_key_test.go +++ b/cli/command/swarm/unlock_key_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/unlock_test.go b/cli/command/swarm/unlock_test.go index 6663df1d..5151d6ba 100644 --- a/cli/command/swarm/unlock_test.go +++ b/cli/command/swarm/unlock_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/update_test.go b/cli/command/swarm/update_test.go index 3c928a2e..e1cd8d7c 100644 --- a/cli/command/swarm/update_test.go +++ b/cli/command/swarm/update_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/system/prune_test.go b/cli/command/system/prune_test.go index 669166c9..0d694ce0 100644 --- a/cli/command/system/prune_test.go +++ b/cli/command/system/prune_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/task/print_test.go b/cli/command/task/print_test.go index 19e02c6d..04ae1bb0 100644 --- a/cli/command/task/print_test.go +++ b/cli/command/task/print_test.go @@ -6,10 +6,10 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "golang.org/x/net/context" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index cf84195f..de534053 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/volume/inspect_test.go b/cli/command/volume/inspect_test.go index fccccf44..57949305 100644 --- a/cli/command/volume/inspect_test.go +++ b/cli/command/volume/inspect_test.go @@ -5,11 +5,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/volume/list_test.go b/cli/command/volume/list_test.go index 0eab71dc..5f5654d5 100644 --- a/cli/command/volume/list_test.go +++ b/cli/command/volume/list_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" volumetypes "github.com/docker/docker/api/types/volume" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index ccb5b15e..788c02b3 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/volume/remove_test.go b/cli/command/volume/remove_test.go index c10b18cc..348714f4 100644 --- a/cli/command/volume/remove_test.go +++ b/cli/command/volume/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/internal/test/builders/config.go b/internal/test/builders/config.go similarity index 100% rename from cli/internal/test/builders/config.go rename to internal/test/builders/config.go diff --git a/cli/internal/test/builders/doc.go b/internal/test/builders/doc.go similarity index 100% rename from cli/internal/test/builders/doc.go rename to internal/test/builders/doc.go diff --git a/cli/internal/test/builders/node.go b/internal/test/builders/node.go similarity index 100% rename from cli/internal/test/builders/node.go rename to internal/test/builders/node.go diff --git a/cli/internal/test/builders/secret.go b/internal/test/builders/secret.go similarity index 100% rename from cli/internal/test/builders/secret.go rename to internal/test/builders/secret.go diff --git a/cli/internal/test/builders/service.go b/internal/test/builders/service.go similarity index 100% rename from cli/internal/test/builders/service.go rename to internal/test/builders/service.go diff --git a/cli/internal/test/builders/swarm.go b/internal/test/builders/swarm.go similarity index 100% rename from cli/internal/test/builders/swarm.go rename to internal/test/builders/swarm.go diff --git a/cli/internal/test/builders/task.go b/internal/test/builders/task.go similarity index 100% rename from cli/internal/test/builders/task.go rename to internal/test/builders/task.go diff --git a/cli/internal/test/builders/volume.go b/internal/test/builders/volume.go similarity index 100% rename from cli/internal/test/builders/volume.go rename to internal/test/builders/volume.go diff --git a/cli/internal/test/cli.go b/internal/test/cli.go similarity index 100% rename from cli/internal/test/cli.go rename to internal/test/cli.go diff --git a/cli/internal/test/doc.go b/internal/test/doc.go similarity index 100% rename from cli/internal/test/doc.go rename to internal/test/doc.go diff --git a/cli/internal/test/network/client.go b/internal/test/network/client.go similarity index 100% rename from cli/internal/test/network/client.go rename to internal/test/network/client.go diff --git a/cli/internal/test/store.go b/internal/test/store.go similarity index 100% rename from cli/internal/test/store.go rename to internal/test/store.go diff --git a/internal/test/testutil/assert.go b/internal/test/testutil/assert.go new file mode 100644 index 00000000..cf5d2c98 --- /dev/null +++ b/internal/test/testutil/assert.go @@ -0,0 +1,15 @@ +package testutil + +import ( + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ErrorContains checks that the error is not nil, and contains the expected +// substring. +// TODO: replace with testify if https://github.com/stretchr/testify/pull/486 +// is accepted. +func ErrorContains(t require.TestingT, err error, expectedError string) { + require.Error(t, err) + assert.Contains(t, err.Error(), expectedError) +}