Skip to content

Commit c5a1bd4

Browse files
committed
Align tests for pubspec with latest code
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 5063b12 commit c5a1bd4

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

tests/packagedcode/data/plugin/help.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ Package: pods
225225
--------------------------------------------
226226
Package: pubspec
227227
class: packagedcode.pubspec:PubspecPackage
228-
metafiles: pubspec.yaml
229-
extensions: .yaml
228+
metafiles: pubspec.yaml, pubspec.lock
229+
extensions: .yaml, .lock
230230

231231
--------------------------------------------
232232
Package: pypi
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"headers": [
3+
{
4+
"tool_name": "scancode-toolkit",
5+
"options": {
6+
"input": "<path>",
7+
"--json": "<file>",
8+
"--package": true,
9+
"--processes": "-1",
10+
"--strip-root": true
11+
},
12+
"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.",
13+
"message": null,
14+
"errors": [],
15+
"extra_data": {
16+
"files_count": 1
17+
}
18+
}
19+
],
20+
"files": [
21+
{
22+
"path": "dart-pubspec.lock",
23+
"type": "file",
24+
"packages": [],
25+
"scan_errors": []
26+
}
27+
]
28+
}

tests/packagedcode/test_plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class TestPlugins(PackageTester):
2020
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
2121

22-
def test_package_list_command(self, regen=True):
22+
def test_package_list_command(self, regen=False):
2323
expected_file = self.get_test_loc('plugin/help.txt')
2424
result = run_scan_click(['--list-packages'])
2525
if regen:
@@ -145,11 +145,11 @@ def test_package_command_scan_pubspec_package(self):
145145
result_file = self.get_temp_file('json')
146146
expected_file = self.get_test_loc('plugin/pubspec-expected.json', must_exist=False)
147147
run_scan_click(['--package', '--strip-root', '--processes', '-1', test_dir, '--json', result_file])
148-
check_json_scan(expected_file, result_file, regen=True)
148+
check_json_scan(expected_file, result_file, regen=False)
149149

150150
def test_package_command_scan_pubspec_lock_package(self):
151151
test_dir = self.get_test_loc('pubspec/locks/dart-pubspec.lock')
152152
result_file = self.get_temp_file('json')
153153
expected_file = self.get_test_loc('plugin/pubspec-lock-expected.json', must_exist=False)
154154
run_scan_click(['--package', '--strip-root', '--processes', '-1', test_dir, '--json', result_file])
155-
check_json_scan(expected_file, result_file, regen=True)
155+
check_json_scan(expected_file, result_file, regen=False)

0 commit comments

Comments
 (0)