mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 23:00:42 -08:00
fix(python): correct handling pip package names with a hyphen (#1771)
This commit is contained in:
@@ -22,6 +22,7 @@ func TestFilesystem(t *testing.T) {
|
||||
ignoreIDs []string
|
||||
policyPaths []string
|
||||
namespaces []string
|
||||
listAllPkgs bool
|
||||
input string
|
||||
}
|
||||
tests := []struct {
|
||||
@@ -41,6 +42,7 @@ func TestFilesystem(t *testing.T) {
|
||||
name: "pip",
|
||||
args: args{
|
||||
securityChecks: "vuln",
|
||||
listAllPkgs: true,
|
||||
input: "testdata/fixtures/fs/pip",
|
||||
},
|
||||
golden: "testdata/pip.json.golden",
|
||||
@@ -129,6 +131,10 @@ func TestFilesystem(t *testing.T) {
|
||||
outputFile = tt.golden
|
||||
}
|
||||
|
||||
if tt.args.listAllPkgs {
|
||||
osArgs = append(osArgs, "--list-all-pkgs")
|
||||
}
|
||||
|
||||
osArgs = append(osArgs, "--output", outputFile)
|
||||
osArgs = append(osArgs, tt.args.input)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user