client/distribution_inspect_test.go
4f0d95fa
 package client // import "github.com/docker/docker/client"
1401342f
 
 import (
7d62e40f
 	"context"
1401342f
 	"net/http"
 	"testing"
 
3e6bbefd
 	"github.com/pkg/errors"
38457285
 	"gotest.tools/assert"
 	is "gotest.tools/assert/cmp"
1401342f
 )
 
 func TestDistributionInspectUnsupported(t *testing.T) {
 	client := &Client{
 		version: "1.29",
 		client:  &http.Client{},
 	}
 	_, err := client.DistributionInspect(context.Background(), "foobar:1.0", "")
6be0f709
 	assert.Check(t, is.Error(err, `"distribution inspect" requires API version 1.30, but the Docker daemon API version is 1.29`))
1401342f
 }
3e6bbefd
 
 func TestDistributionInspectWithEmptyID(t *testing.T) {
 	client := &Client{
 		client: newMockClient(func(req *http.Request) (*http.Response, error) {
 			return nil, errors.New("should not make request")
 		}),
 	}
 	_, err := client.DistributionInspect(context.Background(), "", "")
 	if !IsErrNotFound(err) {
 		t.Fatalf("Expected NotFoundError, got %v", err)
 	}
 }