Skip to content

Commit 06acd33

Browse files
committed
Use less paths for test expectations #180
Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent d4cfac2 commit 06acd33

File tree

2 files changed

+158
-19
lines changed

2 files changed

+158
-19
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"headers": [
3+
{
4+
"tool_name": "scancode-toolkit",
5+
"tool_version": "30.1.0",
6+
"options": {
7+
"input": [
8+
"."
9+
],
10+
"--info": true,
11+
"--json-pp": "../is-npm-1.0.0_scancode_scan.json"
12+
},
13+
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
14+
"start_timestamp": "2021-12-15T212542.730596",
15+
"end_timestamp": "2021-12-15T212542.844045",
16+
"output_format_version": "1.0.0",
17+
"duration": 0.11346149444580078,
18+
"message": null,
19+
"errors": [],
20+
"extra_data": {
21+
"spdx_license_list_version": "3.14",
22+
"files_count": 3
23+
}
24+
}
25+
],
26+
"files": [
27+
{
28+
"path": "is-npm-1.0.0.tgz-extract",
29+
"type": "directory",
30+
"name": "is-npm-1.0.0.tgz-extract",
31+
"base_name": "is-npm-1.0.0.tgz-extract",
32+
"extension": "",
33+
"size": 0,
34+
"date": null,
35+
"sha1": null,
36+
"md5": null,
37+
"sha256": null,
38+
"mime_type": null,
39+
"file_type": null,
40+
"programming_language": null,
41+
"is_binary": false,
42+
"is_text": false,
43+
"is_archive": false,
44+
"is_media": false,
45+
"is_source": false,
46+
"is_script": false,
47+
"files_count": 3,
48+
"dirs_count": 1,
49+
"size_count": 1187,
50+
"scan_errors": []
51+
},
52+
{
53+
"path": "is-npm-1.0.0.tgz-extract/package",
54+
"type": "directory",
55+
"name": "package",
56+
"base_name": "package",
57+
"extension": "",
58+
"size": 0,
59+
"date": null,
60+
"sha1": null,
61+
"md5": null,
62+
"sha256": null,
63+
"mime_type": null,
64+
"file_type": null,
65+
"programming_language": null,
66+
"is_binary": false,
67+
"is_text": false,
68+
"is_archive": false,
69+
"is_media": false,
70+
"is_source": false,
71+
"is_script": false,
72+
"files_count": 3,
73+
"dirs_count": 0,
74+
"size_count": 1187,
75+
"scan_errors": []
76+
},
77+
{
78+
"path": "is-npm-1.0.0.tgz-extract/package/index.js",
79+
"type": "file",
80+
"name": "index.js",
81+
"base_name": "index",
82+
"extension": ".js",
83+
"size": 147,
84+
"date": "2014-07-20",
85+
"sha1": "ecce1fc677fa7d20fc5593b63db45e45c5e8768a",
86+
"md5": "bc4b18b0c8c32b94883d6fc1d675e919",
87+
"sha256": "4044efe5626e2fbc40d3d7ce8b263b831d7644ac179e20cdf15b2794f8934030",
88+
"mime_type": "text/plain",
89+
"file_type": "ASCII text",
90+
"programming_language": "JavaScript",
91+
"is_binary": false,
92+
"is_text": true,
93+
"is_archive": false,
94+
"is_media": false,
95+
"is_source": true,
96+
"is_script": false,
97+
"files_count": 0,
98+
"dirs_count": 0,
99+
"size_count": 0,
100+
"scan_errors": []
101+
},
102+
{
103+
"path": "is-npm-1.0.0.tgz-extract/package/package.json",
104+
"type": "file",
105+
"name": "package.json",
106+
"base_name": "package",
107+
"extension": ".json",
108+
"size": 563,
109+
"date": "2014-07-20",
110+
"sha1": "943efb8abda9b9cdaa4ea73f5709563b948af50b",
111+
"md5": "c843e88ecb274d5d573c71be330bff8b",
112+
"sha256": "522879426298e078881de533b9b3a82fa3bece1336a84bddacf4620008b5d0a3",
113+
"mime_type": "application/json",
114+
"file_type": "JSON data",
115+
"programming_language": null,
116+
"is_binary": false,
117+
"is_text": true,
118+
"is_archive": false,
119+
"is_media": false,
120+
"is_source": false,
121+
"is_script": false,
122+
"files_count": 0,
123+
"dirs_count": 0,
124+
"size_count": 0,
125+
"scan_errors": []
126+
},
127+
{
128+
"path": "is-npm-1.0.0.tgz-extract/package/readme.md",
129+
"type": "file",
130+
"name": "readme.md",
131+
"base_name": "readme",
132+
"extension": ".md",
133+
"size": 477,
134+
"date": "2014-07-20",
135+
"sha1": "b77832e53cb8239edd733c2ca02b1fc01ca3c2b6",
136+
"md5": "a743e0abf08c28a37ecc4bef4dc02f8c",
137+
"sha256": "e98b263545fe62a00c73b57412cbdbcd0792e013a76f9c88342623ab5e8467c1",
138+
"mime_type": "text/plain",
139+
"file_type": "UTF-8 Unicode text",
140+
"programming_language": null,
141+
"is_binary": false,
142+
"is_text": true,
143+
"is_archive": false,
144+
"is_media": false,
145+
"is_source": false,
146+
"is_script": false,
147+
"files_count": 0,
148+
"dirs_count": 0,
149+
"size_count": 0,
150+
"scan_errors": []
151+
}
152+
]
153+
}

scanpipe/tests/test_pipes.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -611,31 +611,17 @@ def test_scanpipe_pipes_scancode_make_results_summary(self):
611611
self.assertEqual(10, len(summary.keys()))
612612

613613
def test_scanpipe_pipes_scancode_replace_root_path_and_name(self):
614-
input_location = self.data_location / "asgiref-3.3.0_scan.json"
614+
input_location = self.data_location / "is-npm-1.0.0_scancode_scan.json"
615615
virtual_codebase = VirtualCodebase(location=input_location)
616616
virtual_codebase_root_replaced = scancode.replace_root_path_and_name(
617617
virtual_codebase
618618
)
619619
expected_topdown_paths = [
620620
".",
621-
"asgiref-3.3.0-py3-none-any.whl",
622-
"asgiref-3.3.0-py3-none-any.whl-extract",
623-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref",
624-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/__init__.py",
625-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/compatibility.py",
626-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/current_thread_executor.py",
627-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/local.py",
628-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/server.py",
629-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/sync.py",
630-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/testing.py",
631-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/timeout.py",
632-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref/wsgi.py",
633-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info",
634-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info/LICENSE",
635-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info/METADATA",
636-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info/RECORD",
637-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info/top_level.txt",
638-
"asgiref-3.3.0-py3-none-any.whl-extract/asgiref-3.3.0.dist-info/WHEEL",
621+
"package",
622+
"package/index.js",
623+
"package/package.json",
624+
"package/readme.md",
639625
]
640626
results = [
641627
resource.path

0 commit comments

Comments
 (0)