mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -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:
@@ -15,26 +15,33 @@ func TestParser_Parse(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
file string
|
||||
want map[string]any
|
||||
want pyproject.PyProject
|
||||
wantErr assert.ErrorAssertionFunc
|
||||
}{
|
||||
{
|
||||
name: "happy path",
|
||||
file: "testdata/happy.toml",
|
||||
want: map[string]any{
|
||||
"flask": "^1.0",
|
||||
"python": "^3.9",
|
||||
"requests": map[string]any{
|
||||
"version": "2.28.1",
|
||||
"optional": true,
|
||||
},
|
||||
"virtualenv": []any{
|
||||
map[string]any{
|
||||
"version": "^20.4.3,!=20.4.5,!=20.4.6",
|
||||
},
|
||||
map[string]any{
|
||||
"version": "<20.16.6",
|
||||
"markers": "sys_platform == 'win32' and python_version == '3.9'",
|
||||
want: pyproject.PyProject{
|
||||
Tool: pyproject.Tool{
|
||||
Poetry: pyproject.Poetry{
|
||||
Dependencies: map[string]struct{}{
|
||||
"flask": {},
|
||||
"python": {},
|
||||
"requests": {},
|
||||
"virtualenv": {},
|
||||
},
|
||||
Groups: map[string]pyproject.Group{
|
||||
"dev": {
|
||||
Dependencies: map[string]struct{}{
|
||||
"pytest": {},
|
||||
},
|
||||
},
|
||||
"lint": {
|
||||
Dependencies: map[string]struct{}{
|
||||
"ruff": {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user