Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Mar 4, 2024
1 parent 4a04cf0 commit 7a3f74b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/advisory/export_test.go
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/wolfi-dev/wolfictl/pkg/configs"
v2 "github.com/wolfi-dev/wolfictl/pkg/configs/advisory/v2"
rwos "github.com/wolfi-dev/wolfictl/pkg/configs/rwfs/os"
Expand Down Expand Up @@ -62,3 +63,25 @@ func Test_ExportFuncs(t *testing.T) {
})
}
}

func TestImportAdvisoriesYAML(t *testing.T) {
cases := []struct {
name string
pathToInputData string
}{
{
name: "test-yaml",
pathToInputData: "./testdata/export/expected.yaml",
},
}

for _, tt := range cases {
t.Run(tt.name, func(t *testing.T) {
tempDir, importedDocuments, err := ImporAdvisoriesYAML(tt.pathToInputData)
require.NoError(t, err)
require.Equal(t, 3, importedDocuments.Select().Len())

defer os.RemoveAll(tempDir)
})
}
}

0 comments on commit 7a3f74b

Please sign in to comment.