Move internal/test package out of cli.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2017-08-21 16:30:09 -04:00
parent 8da1daeefa
commit b3f843afe2
75 changed files with 97 additions and 82 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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)
}