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

Merge pull request #22 from shykes/shykes-0.6.5-dm-plugin

Fix ImageTree test
This commit is contained in:
Michael Crosby 2013-11-12 12:30:30 -08:00
commit a06edd77e5
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 var outs []APIImages
err = json.Unmarshal(body, &outs) if err := json.Unmarshal(body, &outs); err != nil {
if err != nil {
return err return err
} }
var startImageArg = cmd.Arg(0) var (
var startImage APIImages 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 { for _, image := range outs {
if image.ParentId == "" { if image.ParentId == "" {
roots = append(roots, image) roots = append(roots, image)

View file

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