mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 08:56:41 +01:00
chore: redhat cataloger error when sqlite not regsitered (#4150)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package sqlitetest
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/anchore/syft/syft/internal/fileresolver"
|
||||
"github.com/anchore/syft/syft/pkg/cataloger/redhat"
|
||||
)
|
||||
|
||||
func Test_noSQLiteDriverError(t *testing.T) {
|
||||
// this test package does must not import the sqlite library
|
||||
file := "../test-fixtures/Packages"
|
||||
resolver, err := fileresolver.NewFromFile(file, file)
|
||||
require.NoError(t, err)
|
||||
|
||||
cataloger := redhat.NewDBCataloger()
|
||||
_, _, err = cataloger.Catalog(context.TODO(), resolver)
|
||||
require.ErrorContains(t, err, "sqlite")
|
||||
}
|
||||
Reference in New Issue
Block a user