| package client |
| |
| import ( |
| "context" |
| "errors" |
| "net/http" |
| "testing" |
| |
| cerrdefs "github.com/containerd/errdefs" |
| "gotest.tools/v3/assert" |
| is "gotest.tools/v3/assert/cmp" |
| ) |
| |
| func TestDistributionInspectWithEmptyID(t *testing.T) { |
| client, err := New(WithMockClient(func(req *http.Request) (*http.Response, error) { |
| return nil, errors.New("should not make request") |
| })) |
| assert.NilError(t, err) |
| _, err = client.DistributionInspect(context.Background(), "", DistributionInspectOptions{}) |
| assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) |
| } |