Files
attest/attestation/attestation_test.go

19 lines
564 B
Go
Raw Permalink Normal View History

2024-08-12 14:49:52 -05:00
package attestation_test
2024-04-29 15:02:21 -05:00
import (
"testing"
"github.com/docker/attest/attestation"
2024-08-12 14:49:52 -05:00
"github.com/docker/attest/internal/test"
2024-04-29 15:02:21 -05:00
intoto "github.com/in-toto/in-toto-golang/in_toto"
"github.com/stretchr/testify/assert"
)
2024-08-12 14:49:52 -05:00
const ExpectedStatements = 4
2024-04-29 15:02:21 -05:00
func TestExtractAnnotatedStatements(t *testing.T) {
statements, err := attestation.ExtractAnnotatedStatements(test.UnsignedTestImage(".."), intoto.PayloadType)
2024-04-29 15:02:21 -05:00
assert.NoError(t, err)
assert.Equalf(t, len(statements), ExpectedStatements, "expected %d statement, got %d", ExpectedStatements, len(statements))
}