Skip to content

Commit

Permalink
update graph tests
Browse files Browse the repository at this point in the history
Signed-off-by: Anurag <[email protected]>
  • Loading branch information
kranurag7 committed Jul 11, 2023
1 parent 35a94dd commit 583db2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 583db2a

Please sign in to comment.