* Reformat with gofumpt * Suppress issue about laxer perms than 0600 --------- Co-authored-by: Joel Kamp <joel.kamp@docker.com>
22 lines
563 B
Go
22 lines
563 B
Go
package test
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
intoto "github.com/in-toto/in-toto-golang/in_toto"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
var UnsignedTestImage = filepath.Join("..", "..", "test", "testdata", "unsigned-test-image")
|
|
|
|
const (
|
|
ExpectedStatements = 4
|
|
)
|
|
|
|
func TestExtractAnnotatedStatements(t *testing.T) {
|
|
statements, err := ExtractAnnotatedStatements(UnsignedTestImage, intoto.PayloadType)
|
|
assert.NoError(t, err)
|
|
assert.Equalf(t, len(statements), ExpectedStatements, "expected %d statement, got %d", ExpectedStatements, len(statements))
|
|
}
|