Skip to content

Commit

Permalink
fix(tests): fix go tests since in-toto#251
Browse files Browse the repository at this point in the history
The changes in in-toto#251 to update the type of the annotation value in a
resource descriptor was not reflected in the tests, causing them to
fail. Update the tests to use the new annotation value type.

Signed-off-by: Joshua Lock <joshua.lock@uk.verizon.com>
  • Loading branch information
joshuagl committed Jun 28, 2023
1 parent 2be085e commit 29b255b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/v1/resource_descriptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const badRd = `{"downloadLocation":"https://example.com/test.zip","mediaType":"t

func createTestResourceDescriptor() (*ResourceDescriptor, error) {
// Create a ResourceDescriptor
a1, err := structpb.NewStruct(map[string]interface{}{
a1, err := structpb.NewValue(map[string]interface{}{
"keyStr": "value1",
"keyNum": 13})
if err != nil {
return nil, err
}
a2, err := structpb.NewStruct(map[string]interface{}{
a2, err := structpb.NewValue(map[string]interface{}{
"keyObj": map[string]interface{}{
"subKey": "subVal"}})
if err != nil {
Expand All @@ -41,7 +41,7 @@ func createTestResourceDescriptor() (*ResourceDescriptor, error) {
Content: []byte("bytescontent"),
DownloadLocation: "https://example.com/test.zip",
MediaType: "theMediaType",
Annotations: map[string]*structpb.Struct{"a1": a1, "a2": a2},
Annotations: map[string]*structpb.Value{"a1": a1, "a2": a2},
}, nil
}

Expand Down

0 comments on commit 29b255b

Please sign in to comment.