Automated migration

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 39c2ca57c1
Component: cli
This commit is contained in:
Daniel Nephin
2018-03-05 19:41:17 -05:00
parent 40f9f0a5c0
commit ad1a2c9e1d
158 changed files with 1812 additions and 1727 deletions
@@ -12,8 +12,8 @@ import (
. "github.com/docker/cli/internal/test/builders"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/golden"
"github.com/stretchr/testify/assert"
)
func TestTaskPrintWithQuietOption(t *testing.T) {
@@ -24,7 +24,7 @@ func TestTaskPrintWithQuietOption(t *testing.T) {
cli := test.NewFakeCli(apiClient)
tasks := []swarm.Task{*Task(TaskID("id-foo"))}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, formatter.TableFormatKey)
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-quiet-option.golden")
}
@@ -38,7 +38,7 @@ func TestTaskPrintWithNoTruncOption(t *testing.T) {
*Task(TaskID("id-foo-yov6omdek8fg3k5stosyp2m50")),
}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .ID }}")
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-no-trunc-option.golden")
}
@@ -52,7 +52,7 @@ func TestTaskPrintWithGlobalService(t *testing.T) {
*Task(TaskServiceID("service-id-foo"), TaskNodeID("node-id-bar"), TaskSlot(0)),
}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .Name }}")
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-global-service.golden")
}
@@ -66,7 +66,7 @@ func TestTaskPrintWithReplicatedService(t *testing.T) {
*Task(TaskServiceID("service-id-foo"), TaskSlot(1)),
}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .Name }}")
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-replicated-service.golden")
}
@@ -102,7 +102,7 @@ func TestTaskPrintWithIndentation(t *testing.T) {
),
}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, formatter.TableFormatKey)
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-indentation.golden")
}
@@ -123,6 +123,6 @@ func TestTaskPrintWithResolution(t *testing.T) {
*Task(TaskServiceID("service-id-foo"), TaskSlot(1)),
}
err := Print(context.Background(), cli, tasks, idresolver.New(apiClient, noResolve), trunc, quiet, "{{ .Name }} {{ .Node }}")
assert.NoError(t, err)
assert.Check(t, err)
golden.Assert(t, cli.OutBuffer().String(), "task-print-with-resolution.golden")
}