mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-02-01 06:13:18 +08:00
fix(python): skip dev group's deps for poetry (#8106)
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
39
pkg/dependency/parser/python/python_test.go
Normal file
39
pkg/dependency/parser/python/python_test.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package python_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/aquasecurity/trivy/pkg/dependency/parser/python"
|
||||
)
|
||||
|
||||
func Test_NormalizePkgName(t *testing.T) {
|
||||
tests := []struct {
|
||||
pkgName string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
pkgName: "SecretStorage",
|
||||
expected: "secretstorage",
|
||||
},
|
||||
{
|
||||
pkgName: "pywin32-ctypes",
|
||||
expected: "pywin32-ctypes",
|
||||
},
|
||||
{
|
||||
pkgName: "jaraco.classes",
|
||||
expected: "jaraco-classes",
|
||||
},
|
||||
{
|
||||
pkgName: "green_gdk",
|
||||
expected: "green-gdk",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.pkgName, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expected, python.NormalizePkgName(tt.pkgName))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user