Browse code

Fix a test that expects whitespace at the end of the line.

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2016/09/09 04:11:38
Showing 3 changed files
... ...
@@ -6,8 +6,8 @@ import (
6 6
 	"sync"
7 7
 
8 8
 	"github.com/Sirupsen/logrus"
9
-	"github.com/docker/docker/cli/command"
10 9
 	"github.com/docker/docker/api/types"
10
+	"github.com/docker/docker/cli/command"
11 11
 	"github.com/docker/docker/pkg/stdcopy"
12 12
 	"golang.org/x/net/context"
13 13
 )
... ...
@@ -8,8 +8,8 @@ import (
8 8
 	"time"
9 9
 
10 10
 	"github.com/Sirupsen/logrus"
11
-	"github.com/docker/docker/cli/command"
12 11
 	"github.com/docker/docker/api/types"
12
+	"github.com/docker/docker/cli/command"
13 13
 	"github.com/docker/docker/client"
14 14
 	"github.com/docker/docker/pkg/signal"
15 15
 	"golang.org/x/net/context"
... ...
@@ -9,6 +9,7 @@ import (
9 9
 
10 10
 	"github.com/docker/docker/api/types"
11 11
 	"github.com/docker/docker/pkg/stringid"
12
+	"github.com/docker/docker/pkg/testutil/assert"
12 13
 )
13 14
 
14 15
 func TestContainerPsContext(t *testing.T) {
... ...
@@ -232,19 +233,19 @@ containerID2        ubuntu              ""                  24 hours ago
232 232
 image: ubuntu
233 233
 command: ""
234 234
 created_at: %s
235
-status:
235
+status: 
236 236
 names: foobar_baz
237
-labels:
238
-ports:
237
+labels: 
238
+ports: 
239 239
 
240 240
 container_id: containerID2
241 241
 image: ubuntu
242 242
 command: ""
243 243
 created_at: %s
244
-status:
244
+status: 
245 245
 names: foobar_bar
246
-labels:
247
-ports:
246
+labels: 
247
+ports: 
248 248
 
249 249
 `, expectedTime, expectedTime),
250 250
 		},
... ...
@@ -259,20 +260,20 @@ ports:
259 259
 image: ubuntu
260 260
 command: ""
261 261
 created_at: %s
262
-status:
262
+status: 
263 263
 names: foobar_baz
264
-labels:
265
-ports:
264
+labels: 
265
+ports: 
266 266
 size: 0 B
267 267
 
268 268
 container_id: containerID2
269 269
 image: ubuntu
270 270
 command: ""
271 271
 created_at: %s
272
-status:
272
+status: 
273 273
 names: foobar_bar
274
-labels:
275
-ports:
274
+labels: 
275
+ports: 
276 276
 size: 0 B
277 277
 
278 278
 `, expectedTime, expectedTime),
... ...
@@ -316,9 +317,7 @@ size: 0 B
316 316
 		context.context.Containers = containers
317 317
 		context.context.Write()
318 318
 		actual := out.String()
319
-		if actual != context.expected {
320
-			t.Fatalf("Expected \n%s, got \n%s", context.expected, actual)
321
-		}
319
+		assert.Equal(t, actual, context.expected)
322 320
 		// Clean buffer
323 321
 		out.Reset()
324 322
 	}