diff --git a/internal/graph/graph_test.go b/internal/graph/graph_test.go index 5f6cc7bf6..599307fa2 100644 --- a/internal/graph/graph_test.go +++ b/internal/graph/graph_test.go @@ -121,7 +121,7 @@ func TestReferrers(t *testing.T) { index ) anno := map[string]string{"test": "foo"} - appendBlob(ocispec.MediaTypeArtifactManifest, []byte("subject content")) + appendBlob(ocispec.MediaTypeArtifactManifest, []byte(`{"name":"subject content"}`)) imageType := "test.image" appendBlob(imageType, []byte("config content")) generateImage(nil, nil, descs[imgConfig], descs[blob]) @@ -246,7 +246,7 @@ func TestSuccessors(t *testing.T) { artifact index ) - appendBlob(ocispec.MediaTypeArtifactManifest, []byte("subject content")) + appendBlob(ocispec.MediaTypeArtifactManifest, []byte(`{"name":"subject content"}`)) imageType := "test.image" appendBlob(imageType, []byte("config content")) generateImage(&descs[subject], ocispec.MediaTypeImageManifest, descs[config]) @@ -345,7 +345,7 @@ func TestFindReferrerPredecessors(t *testing.T) { image ) var anno map[string]string - appendBlob(ocispec.MediaTypeArtifactManifest, []byte("subject content")) + appendBlob(ocispec.MediaTypeArtifactManifest, []byte(`{"name":"subject content"}`)) imageType := "test.image" appendBlob(imageType, []byte("config content")) generateImage(&descs[subject], anno, descs[imgConfig]) @@ -373,7 +373,6 @@ func TestFindReferrerPredecessors(t *testing.T) { want []ocispec.Descriptor wantErr bool }{ - {"should failed to get referrers", args{ctx, &errLister{}, ocispec.Descriptor{}}, nil, true}, {"should failed to get predecessor", args{ctx, &errFinder{}, ocispec.Descriptor{}}, nil, true}, {"should return referrers when target is a referrer lister", args{ctx, &refLister{referrers: referrers}, ocispec.Descriptor{}}, referrers, false},