Add support for multiple output files in different formats (#732)

This commit is contained in:
Keith Zantow
2022-01-06 17:52:20 -05:00
committed by GitHub
parent 38c4b17847
commit 5e5312c72d
51 changed files with 642 additions and 243 deletions
@@ -11,7 +11,7 @@ import (
func TestPackageOwnershipRelationships(t *testing.T) {
// ensure that the json presenter is applying artifact ownership with an image that has expected ownership relationships
// ensure that the json encoder is applying artifact ownership with an image that has expected ownership relationships
tests := []struct {
fixture string
}{
@@ -24,13 +24,8 @@ func TestPackageOwnershipRelationships(t *testing.T) {
t.Run(test.fixture, func(t *testing.T) {
sbom, _ := catalogFixtureImage(t, test.fixture)
p := syftjson.Format().Presenter(sbom)
if p == nil {
t.Fatal("unable to get presenter")
}
output := bytes.NewBufferString("")
err := p.Present(output)
err := syftjson.Format().Encode(output, sbom)
if err != nil {
t.Fatalf("unable to present: %+v", err)
}