From 623bb6a4a834bbfe1eb295d293e75a1db4505243 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 8 Sep 2016 15:11:38 -0400 Subject: [PATCH] Fix a test that expects whitespace at the end of the line. Signed-off-by: Daniel Nephin Upstream-commit: 485881b038eea7b1cee7f94f1e20e4cd3be85c0c Component: engine --- .../engine/cli/command/container/hijack.go | 2 +- .../engine/cli/command/container/tty.go | 2 +- .../cli/command/formatter/container_test.go | 29 +++++++++---------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/components/engine/cli/command/container/hijack.go b/components/engine/cli/command/container/hijack.go index 855a152904..ea429245cf 100644 --- a/components/engine/cli/command/container/hijack.go +++ b/components/engine/cli/command/container/hijack.go @@ -6,8 +6,8 @@ import ( "sync" "github.com/Sirupsen/logrus" - "github.com/docker/docker/cli/command" "github.com/docker/docker/api/types" + "github.com/docker/docker/cli/command" "github.com/docker/docker/pkg/stdcopy" "golang.org/x/net/context" ) diff --git a/components/engine/cli/command/container/tty.go b/components/engine/cli/command/container/tty.go index 5360c6b040..edb11592d3 100644 --- a/components/engine/cli/command/container/tty.go +++ b/components/engine/cli/command/container/tty.go @@ -8,8 +8,8 @@ import ( "time" "github.com/Sirupsen/logrus" - "github.com/docker/docker/cli/command" "github.com/docker/docker/api/types" + "github.com/docker/docker/cli/command" "github.com/docker/docker/client" "github.com/docker/docker/pkg/signal" "golang.org/x/net/context" diff --git a/components/engine/cli/command/formatter/container_test.go b/components/engine/cli/command/formatter/container_test.go index deaa915a89..29b8450db9 100644 --- a/components/engine/cli/command/formatter/container_test.go +++ b/components/engine/cli/command/formatter/container_test.go @@ -9,6 +9,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/stringid" + "github.com/docker/docker/pkg/testutil/assert" ) func TestContainerPsContext(t *testing.T) { @@ -232,19 +233,19 @@ containerID2 ubuntu "" 24 hours ago image: ubuntu command: "" created_at: %s -status: +status: names: foobar_baz -labels: -ports: +labels: +ports: container_id: containerID2 image: ubuntu command: "" created_at: %s -status: +status: names: foobar_bar -labels: -ports: +labels: +ports: `, expectedTime, expectedTime), }, @@ -259,20 +260,20 @@ ports: image: ubuntu command: "" created_at: %s -status: +status: names: foobar_baz -labels: -ports: +labels: +ports: size: 0 B container_id: containerID2 image: ubuntu command: "" created_at: %s -status: +status: names: foobar_bar -labels: -ports: +labels: +ports: size: 0 B `, expectedTime, expectedTime), @@ -316,9 +317,7 @@ size: 0 B context.context.Containers = containers context.context.Write() actual := out.String() - if actual != context.expected { - t.Fatalf("Expected \n%s, got \n%s", context.expected, actual) - } + assert.Equal(t, actual, context.expected) // Clean buffer out.Reset() }