moby/integration-cli/docker_api_images_test.go

27 lines
542 B
Go
Raw Normal View History

package main
import (
"encoding/json"
"testing"
"github.com/docker/docker/api/types"
)
func TestLegacyImages(t *testing.T) {
_, body, err := sockRequest("GET", "/v1.6/images/json", nil)
if err != nil {
t.Fatalf("Error on GET: %s", err)
}
images := []types.LegacyImage{}
if err = json.Unmarshal(body, &images); err != nil {
t.Fatalf("Error on unmarshal: %s", err)
}
if len(images) == 0 || images[0].Tag == "" || images[0].Repository == "" {
t.Fatalf("Bad data: %q", images)
}
logDone("images - checking legacy json")
}