Files
moby/client/distribution_inspect_test.go
Sebastiaan van Stijn c950796596 client: use t.Context in tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-10 23:23:23 +01:00

21 lines
529 B
Go

package client
import (
"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(t.Context(), "", DistributionInspectOptions{})
assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound))
}