mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
testing: remove custom testingT interfaces
now that we no longer use gocheck, we should be able to just use golang's own interface. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
3e4f6225da
commit
d79cc1b67d
13 changed files with 48 additions and 121 deletions
|
@ -3,17 +3,12 @@ package build // import "github.com/docker/docker/integration-cli/cli/build"
|
|||
import (
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/testutil/fakecontext"
|
||||
"gotest.tools/icmd"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
Fatal(args ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
// WithStdinContext sets the build context from the standard input with the specified reader
|
||||
func WithStdinContext(closer io.ReadCloser) func(*icmd.Cmd) func() {
|
||||
return func(cmd *icmd.Cmd) func() {
|
||||
|
@ -59,7 +54,7 @@ func WithExternalBuildContext(ctx *fakecontext.Fake) func(*icmd.Cmd) func() {
|
|||
}
|
||||
|
||||
// WithBuildContext sets up the build context
|
||||
func WithBuildContext(t testingT, contextOperators ...func(*fakecontext.Fake) error) func(*icmd.Cmd) func() {
|
||||
func WithBuildContext(t testing.TB, contextOperators ...func(*fakecontext.Fake) error) func(*icmd.Cmd) func() {
|
||||
// FIXME(vdemeester) de-duplicate that
|
||||
ctx := fakecontext.New(t, "", contextOperators...)
|
||||
return func(cmd *icmd.Cmd) func() {
|
||||
|
@ -74,7 +69,7 @@ func WithFile(name, content string) func(*fakecontext.Fake) error {
|
|||
return fakecontext.WithFile(name, content)
|
||||
}
|
||||
|
||||
func closeBuildContext(t testingT, ctx *fakecontext.Fake) func() {
|
||||
func closeBuildContext(t testing.TB, ctx *fakecontext.Fake) func() {
|
||||
return func() {
|
||||
if err := ctx.Close(); err != nil {
|
||||
t.Fatal(err)
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/integration-cli/daemon"
|
||||
"github.com/docker/docker/integration-cli/environment"
|
||||
"github.com/pkg/errors"
|
||||
"gotest.tools/assert"
|
||||
"gotest.tools/icmd"
|
||||
)
|
||||
|
||||
|
@ -24,46 +24,39 @@ func SetTestEnvironment(env *environment.Execution) {
|
|||
// CmdOperator defines functions that can modify a command
|
||||
type CmdOperator func(*icmd.Cmd) func()
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
Fatal(args ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
// DockerCmd executes the specified docker command and expect a success
|
||||
func DockerCmd(t testingT, args ...string) *icmd.Result {
|
||||
func DockerCmd(t testing.TB, args ...string) *icmd.Result {
|
||||
return Docker(Args(args...)).Assert(t, icmd.Success)
|
||||
}
|
||||
|
||||
// BuildCmd executes the specified docker build command and expect a success
|
||||
func BuildCmd(t testingT, name string, cmdOperators ...CmdOperator) *icmd.Result {
|
||||
func BuildCmd(t testing.TB, name string, cmdOperators ...CmdOperator) *icmd.Result {
|
||||
return Docker(Build(name), cmdOperators...).Assert(t, icmd.Success)
|
||||
}
|
||||
|
||||
// InspectCmd executes the specified docker inspect command and expect a success
|
||||
func InspectCmd(t testingT, name string, cmdOperators ...CmdOperator) *icmd.Result {
|
||||
func InspectCmd(t testing.TB, name string, cmdOperators ...CmdOperator) *icmd.Result {
|
||||
return Docker(Inspect(name), cmdOperators...).Assert(t, icmd.Success)
|
||||
}
|
||||
|
||||
// WaitRun will wait for the specified container to be running, maximum 5 seconds.
|
||||
func WaitRun(t testingT, name string, cmdOperators ...CmdOperator) {
|
||||
func WaitRun(t testing.TB, name string, cmdOperators ...CmdOperator) {
|
||||
WaitForInspectResult(t, name, "{{.State.Running}}", "true", 5*time.Second, cmdOperators...)
|
||||
}
|
||||
|
||||
// WaitExited will wait for the specified container to state exit, subject
|
||||
// to a maximum time limit in seconds supplied by the caller
|
||||
func WaitExited(t testingT, name string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
func WaitExited(t testing.TB, name string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
WaitForInspectResult(t, name, "{{.State.Status}}", "exited", timeout, cmdOperators...)
|
||||
}
|
||||
|
||||
// WaitRestart will wait for the specified container to restart once
|
||||
func WaitRestart(t testingT, name string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
func WaitRestart(t testing.TB, name string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
WaitForInspectResult(t, name, "{{.RestartCount}}", "1", timeout, cmdOperators...)
|
||||
}
|
||||
|
||||
// WaitForInspectResult waits for the specified expression to be equals to the specified expected string in the given time.
|
||||
func WaitForInspectResult(t testingT, name, expr, expected string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
func WaitForInspectResult(t testing.TB, name, expr, expected string, timeout time.Duration, cmdOperators ...CmdOperator) {
|
||||
after := time.After(timeout)
|
||||
|
||||
args := []string{"inspect", "-f", expr, name}
|
||||
|
|
|
@ -12,17 +12,6 @@ import (
|
|||
"gotest.tools/icmd"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
logT
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
||||
// Daemon represents a Docker daemon for the testing framework.
|
||||
type Daemon struct {
|
||||
*daemon.Daemon
|
||||
|
@ -32,7 +21,7 @@ type Daemon struct {
|
|||
// New returns a Daemon instance to be used for testing.
|
||||
// This will create a directory such as d123456789 in the folder specified by $DOCKER_INTEGRATION_DAEMON_DEST or $DEST.
|
||||
// The daemon will not automatically start.
|
||||
func New(t testingT, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
|
||||
func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
|
||||
ops = append(ops, daemon.WithDockerdBinary(dockerdBinary))
|
||||
d := daemon.New(t, ops...)
|
||||
return &Daemon{
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
|
@ -28,13 +29,6 @@ import (
|
|||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
logT
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
@ -143,7 +137,7 @@ func NewDaemon(workingDir string, ops ...Option) (*Daemon, error) {
|
|||
// This will create a directory such as d123456789 in the folder specified by
|
||||
// $DOCKER_INTEGRATION_DAEMON_DEST or $DEST.
|
||||
// The daemon will not automatically start.
|
||||
func New(t testingT, ops ...Option) *Daemon {
|
||||
func New(t testing.TB, ops ...Option) *Daemon {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -224,7 +218,7 @@ func (d *Daemon) NewClient(extraOpts ...client.Opt) (*client.Client, error) {
|
|||
}
|
||||
|
||||
// Cleanup cleans the daemon files : exec root (network namespaces, ...), swarmkit files
|
||||
func (d *Daemon) Cleanup(t testingT) {
|
||||
func (d *Daemon) Cleanup(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -234,7 +228,7 @@ func (d *Daemon) Cleanup(t testingT) {
|
|||
}
|
||||
|
||||
// Start starts the daemon and return once it is ready to receive requests.
|
||||
func (d *Daemon) Start(t testingT, args ...string) {
|
||||
func (d *Daemon) Start(t testing.TB, args ...string) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -390,7 +384,7 @@ func (d *Daemon) StartWithLogFile(out *os.File, providedArgs ...string) error {
|
|||
|
||||
// StartWithBusybox will first start the daemon with Daemon.Start()
|
||||
// then save the busybox image from the main daemon and load it into this Daemon instance.
|
||||
func (d *Daemon) StartWithBusybox(t testingT, arg ...string) {
|
||||
func (d *Daemon) StartWithBusybox(t testing.TB, arg ...string) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -449,7 +443,7 @@ func (d *Daemon) DumpStackAndQuit() {
|
|||
// Stop will not delete the daemon directory. If a purged daemon is needed,
|
||||
// instantiate a new one with NewDaemon.
|
||||
// If an error occurs while starting the daemon, the test will fail.
|
||||
func (d *Daemon) Stop(t testingT) {
|
||||
func (d *Daemon) Stop(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -537,7 +531,7 @@ out2:
|
|||
|
||||
// Restart will restart the daemon by first stopping it and the starting it.
|
||||
// If an error occurs while starting the daemon, the test will fail.
|
||||
func (d *Daemon) Restart(t testingT, args ...string) {
|
||||
func (d *Daemon) Restart(t testing.TB, args ...string) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -737,7 +731,7 @@ func (d *Daemon) Info(t assert.TestingT) types.Info {
|
|||
return info
|
||||
}
|
||||
|
||||
func cleanupRaftDir(t testingT, rootPath string) {
|
||||
func cleanupRaftDir(t testing.TB, rootPath string) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
|
@ -7,13 +7,14 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/testutil"
|
||||
"golang.org/x/sys/unix"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
func cleanupNetworkNamespace(t testingT, execRoot string) {
|
||||
func cleanupNetworkNamespace(t testing.TB, execRoot string) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -33,7 +34,7 @@ func cleanupNetworkNamespace(t testingT, execRoot string) {
|
|||
}
|
||||
|
||||
// CgroupNamespace returns the cgroup namespace the daemon is running in
|
||||
func (d *Daemon) CgroupNamespace(t assert.TestingT) string {
|
||||
func (d *Daemon) CgroupNamespace(t testing.TB) string {
|
||||
link, err := os.Readlink(fmt.Sprintf("/proc/%d/ns/cgroup", d.Pid()))
|
||||
assert.NilError(t, err)
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package daemon
|
|||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
"gotest.tools/assert"
|
||||
|
@ -22,11 +23,11 @@ func signalDaemonReload(pid int) error {
|
|||
return fmt.Errorf("daemon reload not supported")
|
||||
}
|
||||
|
||||
func cleanupNetworkNamespace(t testingT, execRoot string) {
|
||||
func cleanupNetworkNamespace(t testing.TB, execRoot string) {
|
||||
}
|
||||
|
||||
// CgroupNamespace returns the cgroup namespace the daemon is running in
|
||||
func (d *Daemon) CgroupNamespace(t assert.TestingT) string {
|
||||
func (d *Daemon) CgroupNamespace(t testing.TB) string {
|
||||
assert.Assert(t, false)
|
||||
return "cgroup namespaces are not supported on Windows"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package daemon
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/testutil"
|
||||
|
@ -21,7 +22,7 @@ var (
|
|||
)
|
||||
|
||||
// StartNode (re)starts the daemon
|
||||
func (d *Daemon) StartNode(t testingT) {
|
||||
func (d *Daemon) StartNode(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -29,7 +30,7 @@ func (d *Daemon) StartNode(t testingT) {
|
|||
}
|
||||
|
||||
// StartNodeWithBusybox starts daemon to be used as a swarm node, and loads the busybox image
|
||||
func (d *Daemon) StartNodeWithBusybox(t testingT) {
|
||||
func (d *Daemon) StartNodeWithBusybox(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -37,7 +38,7 @@ func (d *Daemon) StartNodeWithBusybox(t testingT) {
|
|||
}
|
||||
|
||||
// RestartNode restarts a daemon to be used as a swarm node
|
||||
func (d *Daemon) RestartNode(t testingT) {
|
||||
func (d *Daemon) RestartNode(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -47,13 +48,13 @@ func (d *Daemon) RestartNode(t testingT) {
|
|||
}
|
||||
|
||||
// StartAndSwarmInit starts the daemon (with busybox) and init the swarm
|
||||
func (d *Daemon) StartAndSwarmInit(t testingT) {
|
||||
func (d *Daemon) StartAndSwarmInit(t testing.TB) {
|
||||
d.StartNodeWithBusybox(t)
|
||||
d.SwarmInit(t, swarm.InitRequest{})
|
||||
}
|
||||
|
||||
// StartAndSwarmJoin starts the daemon (with busybox) and join the specified swarm as worker or manager
|
||||
func (d *Daemon) StartAndSwarmJoin(t testingT, leader *Daemon, manager bool) {
|
||||
func (d *Daemon) StartAndSwarmJoin(t testing.TB, leader *Daemon, manager bool) {
|
||||
if th, ok := t.(testutil.HelperT); ok {
|
||||
th.Helper()
|
||||
}
|
||||
|
|
|
@ -6,19 +6,14 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/testutil"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
Fatal(args ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
// New creates a fake build context
|
||||
func New(t testingT, dir string, modifiers ...func(*Fake) error) *Fake {
|
||||
func New(t testing.TB, dir string, modifiers ...func(*Fake) error) *Fake {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -120,7 +115,7 @@ func (f *Fake) Close() error {
|
|||
}
|
||||
|
||||
// AsTarReader returns a ReadCloser with the contents of Dir as a tar archive.
|
||||
func (f *Fake) AsTarReader(t testingT) io.ReadCloser {
|
||||
func (f *Fake) AsTarReader(t testing.TB) io.ReadCloser {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
|
@ -8,30 +8,13 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/testutil"
|
||||
"github.com/docker/docker/testutil/fakecontext"
|
||||
"github.com/docker/docker/testutil/fakestorage"
|
||||
"gotest.tools/assert"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
logT
|
||||
skipT
|
||||
Fatal(args ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
||||
type skipT interface {
|
||||
Skip(...interface{})
|
||||
}
|
||||
|
||||
type gitServer interface {
|
||||
URL() string
|
||||
Close() error
|
||||
|
@ -64,7 +47,7 @@ func (g *FakeGit) Close() {
|
|||
}
|
||||
|
||||
// New create a fake git server that can be used for git related tests
|
||||
func New(c testingT, name string, files map[string]string, enforceLocalServer bool) *FakeGit {
|
||||
func New(c testing.TB, name string, files map[string]string, enforceLocalServer bool) *FakeGit {
|
||||
if ht, ok := c.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
|
@ -17,7 +18,7 @@ import (
|
|||
|
||||
var ensureHTTPServerOnce sync.Once
|
||||
|
||||
func ensureHTTPServerImage(t testingT) {
|
||||
func ensureHTTPServerImage(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
|
@ -24,23 +25,6 @@ import (
|
|||
|
||||
var testEnv *environment.Execution
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
logT
|
||||
skipT
|
||||
Fatal(args ...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
||||
type skipT interface {
|
||||
Skip(...interface{})
|
||||
}
|
||||
|
||||
// Fake is a static file server. It might be running locally or remotely
|
||||
// on test host.
|
||||
type Fake interface {
|
||||
|
@ -56,7 +40,7 @@ func SetTestEnvironment(env *environment.Execution) {
|
|||
}
|
||||
|
||||
// New returns a static file server that will be use as build context.
|
||||
func New(t testingT, dir string, modifiers ...func(*fakecontext.Fake) error) Fake {
|
||||
func New(t testing.TB, dir string, modifiers ...func(*fakecontext.Fake) error) Fake {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -149,7 +133,7 @@ func (f *remoteFileServer) Close() error {
|
|||
})
|
||||
}
|
||||
|
||||
func newRemoteFileServer(t testingT, ctx *fakecontext.Fake, c client.APIClient) *remoteFileServer {
|
||||
func newRemoteFileServer(t testing.TB, ctx *fakecontext.Fake, c client.APIClient) *remoteFileServer {
|
||||
var (
|
||||
image = fmt.Sprintf("fileserver-img-%s", strings.ToLower(testutil.GenerateRandomAlphaOnlyString(10)))
|
||||
container = fmt.Sprintf("fileserver-cnt-%s", strings.ToLower(testutil.GenerateRandomAlphaOnlyString(10)))
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/testutil"
|
||||
|
@ -23,18 +24,6 @@ const (
|
|||
DefaultURL = "127.0.0.1:5000"
|
||||
)
|
||||
|
||||
type testingT interface {
|
||||
assert.TestingT
|
||||
logT
|
||||
Fatal(...interface{})
|
||||
Fatalf(string, ...interface{})
|
||||
Name() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
||||
// V2 represent a registry version 2
|
||||
type V2 struct {
|
||||
cmd *exec.Cmd
|
||||
|
@ -55,7 +44,7 @@ type Config struct {
|
|||
}
|
||||
|
||||
// NewV2 creates a v2 registry server
|
||||
func NewV2(t testingT, ops ...func(*Config)) *V2 {
|
||||
func NewV2(t testing.TB, ops ...func(*Config)) *V2 {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -140,7 +129,7 @@ http:
|
|||
}
|
||||
|
||||
// WaitReady waits for the registry to be ready to serve requests (or fail after a while)
|
||||
func (r *V2) WaitReady(t testingT) {
|
||||
func (r *V2) WaitReady(t testing.TB) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
@ -212,7 +201,7 @@ func (r *V2) WriteBlobContents(t assert.TestingT, blobDigest digest.Digest, data
|
|||
|
||||
// TempMoveBlobData moves the existing data file aside, so that we can replace it with a
|
||||
// malicious blob of data for example.
|
||||
func (r *V2) TempMoveBlobData(t testingT, blobDigest digest.Digest) (undo func()) {
|
||||
func (r *V2) TempMoveBlobData(t testing.TB, blobDigest digest.Digest) (undo func()) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/testutil"
|
||||
)
|
||||
|
@ -28,7 +29,7 @@ func (tr *Mock) RegisterHandler(path string, h handlerFunc) {
|
|||
}
|
||||
|
||||
// NewMock creates a registry mock
|
||||
func NewMock(t testingT) (*Mock, error) {
|
||||
func NewMock(t testing.TB) (*Mock, error) {
|
||||
if ht, ok := t.(testutil.HelperT); ok {
|
||||
ht.Helper()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue