fix(python): correct handling pip package names with a hyphen (#1771)

This commit is contained in:
afdesk
2022-02-27 21:47:53 +06:00
committed by GitHub
parent a069ad7818
commit a423b99312
5 changed files with 52 additions and 6 deletions

View File

@@ -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)