1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Cleanup errorOut resp in images tests

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
This commit is contained in:
Jessica Frazelle 2014-10-14 14:07:30 -07:00
parent 50c3e7537c
commit dd248dee3c

View file

@ -1,7 +1,6 @@
package main
import (
"fmt"
"os/exec"
"strings"
"testing"
@ -11,7 +10,9 @@ import (
func TestImagesEnsureImageIsListed(t *testing.T) {
imagesCmd := exec.Command(dockerBinary, "images")
out, _, err := runCommandWithOutput(imagesCmd)
errorOut(err, t, fmt.Sprintf("listing images failed with errors: %v", err))
if err != nil {
t.Fatalf("listing images failed with errors: %s, %v", out, err)
}
if !strings.Contains(out, "busybox") {
t.Fatal("images should've listed busybox")
@ -46,7 +47,9 @@ func TestImagesOrderedByCreationDate(t *testing.T) {
}
out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "images", "-q", "--no-trunc"))
errorOut(err, t, fmt.Sprintf("listing images failed with errors: %v", err))
if err != nil {
t.Fatalf("listing images failed with errors: %s, %v", out, err)
}
imgs := strings.Split(out, "\n")
if imgs[0] != id3 {
t.Fatalf("First image must be %s, got %s", id3, imgs[0])