diff --git a/pkg/attestation/referrers_test.go b/pkg/attestation/referrers_test.go index 28cb25b..9d7d272 100644 --- a/pkg/attestation/referrers_test.go +++ b/pkg/attestation/referrers_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/docker/attest/internal/test" - "github.com/docker/attest/internal/util" "github.com/docker/attest/pkg/attest" "github.com/docker/attest/pkg/attestation" "github.com/docker/attest/pkg/config" @@ -16,7 +15,6 @@ import ( "github.com/docker/attest/pkg/policy" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/registry" - "github.com/google/go-containerregistry/pkg/v1/empty" "github.com/google/go-containerregistry/pkg/v1/remote" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -328,14 +326,3 @@ func TestCorrectArtifactTypeInTagFallback(t *testing.T) { } } } - -func TestEmptyConfigImageDigest(t *testing.T) { - empty := empty.Image - img := oci.EmptyConfigImage{Image: empty} - mf, err := img.RawManifest() - require.NoError(t, err) - hash := util.SHA256Hex(mf) - digest, err := img.Digest() - require.NoError(t, err) - assert.Equal(t, digest.Hex, hash) -} diff --git a/pkg/oci/types_test.go b/pkg/oci/types_test.go new file mode 100644 index 0000000..704fdd9 --- /dev/null +++ b/pkg/oci/types_test.go @@ -0,0 +1,21 @@ +package oci + +import ( + "testing" + + "github.com/docker/attest/internal/util" + "github.com/google/go-containerregistry/pkg/v1/empty" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestEmptyConfigImageDigest(t *testing.T) { + empty := empty.Image + img := EmptyConfigImage{Image: empty} + mf, err := img.RawManifest() + require.NoError(t, err) + hash := util.SHA256Hex(mf) + digest, err := img.Digest() + require.NoError(t, err) + assert.Equal(t, digest.Hex, hash) +}