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
Родитель 50d80a8938 08623dc216
Коммит a06edd77e5
2 изменённых файлов: 12 добавлений и 11 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -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{}