Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lixia (Sylvia) Lei <lixlei@microsoft.com>
  • Loading branch information
Wwwsylvia committed Jul 13, 2023
1 parent d91d814 commit 1a1e8f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,18 @@ func Test_Pack_WithOptions(t *testing.T) {
ArtifactType: artifactType,
Annotations: annotations,
}
configBytes := []byte("{}")
configDesc := content.NewDescriptorFromBytes("testconfig", configBytes)
configAnnotations := map[string]string{"foo": "bar"}

// test Pack
ctx := context.Background()
opts := PackOptions{
Subject: &subjectDesc,
ManifestAnnotations: annotations,
ConfigDescriptor: &configDesc, // should not work
ConfigAnnotations: configAnnotations, // should not work
PackManifestType: PackManifestTypeImageManifest, // should not work
}
manifestDesc, err := Pack(ctx, s, artifactType, blobs, opts)
if err != nil {
Expand Down Expand Up @@ -390,6 +396,7 @@ func Test_Pack_ImageLegacy_WithOptions(t *testing.T) {
// test Pack without ConfigDescriptor
opts = PackOptions{
PackImageManifest: true,
PackManifestType: PackManifestTypeImageManifestLegacy,
Subject: &subjectDesc,
ConfigAnnotations: configAnnotations,
ManifestAnnotations: annotations,
Expand Down

0 comments on commit 1a1e8f6

Please sign in to comment.