mirror of
https://github.com/docker/cli.git
synced 2026-09-27 17:56:04 -04:00
Fix a test that expects whitespace at the end of the line.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e2f7387906
Component: cli
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/docker/cli/command"
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
"github.com/docker/docker/cli/command"
|
||||||
"github.com/docker/docker/pkg/stdcopy"
|
"github.com/docker/docker/pkg/stdcopy"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
"github.com/docker/docker/cli/command"
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
"github.com/docker/docker/cli/command"
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/docker/docker/pkg/signal"
|
"github.com/docker/docker/pkg/signal"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/pkg/stringid"
|
"github.com/docker/docker/pkg/stringid"
|
||||||
|
"github.com/docker/docker/pkg/testutil/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestContainerPsContext(t *testing.T) {
|
func TestContainerPsContext(t *testing.T) {
|
||||||
@@ -232,19 +233,19 @@ containerID2 ubuntu "" 24 hours ago
|
|||||||
image: ubuntu
|
image: ubuntu
|
||||||
command: ""
|
command: ""
|
||||||
created_at: %s
|
created_at: %s
|
||||||
status:
|
status:
|
||||||
names: foobar_baz
|
names: foobar_baz
|
||||||
labels:
|
labels:
|
||||||
ports:
|
ports:
|
||||||
|
|
||||||
container_id: containerID2
|
container_id: containerID2
|
||||||
image: ubuntu
|
image: ubuntu
|
||||||
command: ""
|
command: ""
|
||||||
created_at: %s
|
created_at: %s
|
||||||
status:
|
status:
|
||||||
names: foobar_bar
|
names: foobar_bar
|
||||||
labels:
|
labels:
|
||||||
ports:
|
ports:
|
||||||
|
|
||||||
`, expectedTime, expectedTime),
|
`, expectedTime, expectedTime),
|
||||||
},
|
},
|
||||||
@@ -259,20 +260,20 @@ ports:
|
|||||||
image: ubuntu
|
image: ubuntu
|
||||||
command: ""
|
command: ""
|
||||||
created_at: %s
|
created_at: %s
|
||||||
status:
|
status:
|
||||||
names: foobar_baz
|
names: foobar_baz
|
||||||
labels:
|
labels:
|
||||||
ports:
|
ports:
|
||||||
size: 0 B
|
size: 0 B
|
||||||
|
|
||||||
container_id: containerID2
|
container_id: containerID2
|
||||||
image: ubuntu
|
image: ubuntu
|
||||||
command: ""
|
command: ""
|
||||||
created_at: %s
|
created_at: %s
|
||||||
status:
|
status:
|
||||||
names: foobar_bar
|
names: foobar_bar
|
||||||
labels:
|
labels:
|
||||||
ports:
|
ports:
|
||||||
size: 0 B
|
size: 0 B
|
||||||
|
|
||||||
`, expectedTime, expectedTime),
|
`, expectedTime, expectedTime),
|
||||||
@@ -316,9 +317,7 @@ size: 0 B
|
|||||||
context.context.Containers = containers
|
context.context.Containers = containers
|
||||||
context.context.Write()
|
context.context.Write()
|
||||||
actual := out.String()
|
actual := out.String()
|
||||||
if actual != context.expected {
|
assert.Equal(t, actual, context.expected)
|
||||||
t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
|
|
||||||
}
|
|
||||||
// Clean buffer
|
// Clean buffer
|
||||||
out.Reset()
|
out.Reset()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user