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

Fix ImageTree test

This commit is contained in:
Guillaume J. Charmes 2013-11-12 12:25:35 -08:00
parent 0dd92d8f1c
commit 08623dc216
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3
2 changed files with 12 additions and 11 deletions

View file

@ -1100,16 +1100,18 @@ func (cli *DockerCli) CmdImages(args ...string) error {
}
var outs []APIImages
err = json.Unmarshal(body, &outs)
if err != nil {
if err := json.Unmarshal(body, &outs); err != nil {
return err
}
var startImageArg = cmd.Arg(0)
var startImage APIImages
var (
startImageArg = cmd.Arg(0)
startImage APIImages
roots []APIImages
byParent = make(map[string][]APIImages)
)
var roots []APIImages
var byParent = make(map[string][]APIImages)
for _, image := range outs {
if image.ParentId == "" {
roots = append(roots, image)

View file

@ -776,13 +776,12 @@ func TestImagesTree(t *testing.T) {
t.Fatal(err)
}
cmdOutput := string(cmdOutputBytes)
regexpStrings := []string{
fmt.Sprintf("└─%s Size: (\\d+.\\d+ MB) \\(virtual \\d+.\\d+ MB\\) Tags: %s:latest", unitTestImageIDShort, unitTestImageName),
"(?m)^ └─[0-9a-f]+",
"(?m)^ └─[0-9a-f]+",
"(?m)^ └─[0-9a-f]+",
fmt.Sprintf(" └─%s Size: \\d+ B \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
"(?m) └─[0-9a-f]+.*",
"(?m) └─[0-9a-f]+.*",
"(?m) └─[0-9a-f]+.*",
fmt.Sprintf("(?m)^ └─%s Size: \\d+.\\d+ MB \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
}
compiledRegexps := []*regexp.Regexp{}