Migrate format definitions to sbom package (#864)

This commit is contained in:
Alex Goodman
2022-03-04 17:22:40 -05:00
committed by GitHub
parent 640099ce2e
commit 4af32c5bee
36 changed files with 580 additions and 401 deletions
+5 -3
View File
@@ -2,10 +2,11 @@ package cli
import (
"fmt"
"github.com/stretchr/testify/require"
"strings"
"testing"
"github.com/anchore/syft/syft/format"
"github.com/anchore/syft/syft"
)
func TestAllFormatsExpressible(t *testing.T) {
@@ -18,8 +19,9 @@ func TestAllFormatsExpressible(t *testing.T) {
},
assertSuccessfulReturnCode,
}
for _, o := range format.AllOptions {
formats := syft.FormatIDs()
require.NotEmpty(t, formats)
for _, o := range formats {
t.Run(fmt.Sprintf("format:%s", o), func(t *testing.T) {
cmd, stdout, stderr := runSyft(t, nil, "dir:./test-fixtures/image-pkg-coverage", "-o", string(o))
for _, traitFn := range commonAssertions {
-2
View File
@@ -122,8 +122,6 @@ func TestLogFile(t *testing.T) {
request := "docker-archive:" + getFixtureImage(t, "image-pkg-coverage")
envLogFile := filepath.Join(os.TempDir(), "a-pretty-log-file.log")
t.Logf("log file path: %s", envLogFile)
tests := []struct {
name string
args []string