Skip to content

Commit da7057f

Browse files
committed
Refine CLI testing
* Make it data driven and test the whole result againsta JSON file * Add new test for a requirements files * Use regeneration of fixtures with the PYINSP_REGEN_TEST_FIXTURES=yes environment variable. Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 16cdee9 commit da7057f

6 files changed

Lines changed: 663 additions & 26 deletions
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"headers": {
3+
"tool_name": "dad",
4+
"tool_homepageurl": "https://github.com/nexB/python-inspector",
5+
"tool_version": "0.5.0",
6+
"options": [
7+
"--specifier zipp==3.8.0",
8+
"--index-url https://pypi.org/simple",
9+
"--python-version 38",
10+
"--operating-system linux",
11+
"--json <file>"
12+
],
13+
"notice": "Dependency tree generated with python-inspector.\npython-inspector is a free software tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
14+
"warnings": [],
15+
"errors": []
16+
},
17+
"requirements": [
18+
{
19+
"purl": "pkg:pypi/zipp@3.8.0",
20+
"extracted_requirement": "zipp==3.8.0",
21+
"scope": "install",
22+
"is_runtime": true,
23+
"is_optional": false,
24+
"is_resolved": true,
25+
"resolved_package": {}
26+
}
27+
],
28+
"resolved_dependencies": [
29+
{
30+
"package": "pkg:pypi/zipp@3.8.0",
31+
"dependencies": []
32+
}
33+
]
34+
}

tests/data/pinned-requirements.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
attrs==21.4.0
2+
beautifulsoup4==4.11.1
3+
certifi==2022.5.18.1
4+
charset-normalizer==2.0.12
5+
click==8.0.4
6+
colorama==0.4.4
7+
commoncode==30.2.0
8+
dparse2==0.6.1
9+
idna==3.3
10+
importlib-metadata==4.8.3
11+
intbitset==3.0.1
12+
packageurl-python==0.9.9
13+
packaging==21.3
14+
pip-requirements-parser==31.2.0
15+
pkginfo2==30.0.0
16+
pyparsing==3.0.9
17+
PyYAML==6.0
18+
requests==2.27.1
19+
resolvelib==0.8.1
20+
saneyaml==0.5.2
21+
soupsieve==2.3.2.post1
22+
text-unidecode==1.3
23+
toml==0.10.2
24+
typing==3.6.6
25+
typing_extensions==4.1.1
26+
urllib3==1.26.9
27+
zipp==3.6.0

0 commit comments

Comments
 (0)