Skip to content

Commit 2b64449

Browse files
committed
Use plain JSON test file
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 88b5144 commit 2b64449

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

tests/packagedcode/test_rpm_installed.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -131,29 +131,7 @@ def test_parse_rpm_xmlish_can_parse_rhel(self):
131131
def test_scan_system_package_end_to_end_installed_rpms_fedora_bdb(self):
132132
test_dir = self.extract_test_tar('rpm_installed/end-to-end/bdb-fedora-rootfs.tar.xz')
133133
test_dir = os.path.join(test_dir, 'rootfs')
134-
135-
# To regen this test expected tarball:
136-
# - regen the test with SCANCODE_REGEN_TEST_FIXTURES=yes
137-
# - in a shell Then run `tar -cJf bdb-fedora-rootfs.tar.xz-expected.json.tar.xz bdb-fedora-rootfs.tar.xz-expected.json`
138-
# - Remove the extracted json
139-
140-
# To regen this test and see changes:
141-
# - Extract `bdb-fedora-rootfs.tar.xz-expected.json.tar.xz` and stage the changes, then regen to see changes
142-
# - regen the test with SCANCODE_REGEN_TEST_FIXTURES=yes
143-
# - in a shell Then run `tar -cJf bdb-fedora-rootfs.tar.xz-expected.json.tar.xz bdb-fedora-rootfs.tar.xz-expected.json`
144-
# - Remove the extracted json
145-
146-
regen = REGEN_TEST_FIXTURES
147-
expected = 'bdb-fedora-rootfs.tar.xz-expected.json'
148-
149-
expected_file_tarball = f'rpm_installed/end-to-end/{expected}.tar.xz'
150-
if regen:
151-
# regen is special because we compress the JSON
152-
expected_file = self.get_test_loc(f'rpm_installed/end-to-end/{expected}', must_exist=False)
153-
else:
154-
expected_file = self.extract_test_tar(expected_file_tarball)
155-
expected_file = os.path.join(expected_file, expected)
156-
134+
expected_file = self.get_test_loc(f'rpm_installed/end-to-end/bdb-fedora-rootfs.tar.xz-expected.json')
157135
result_file = self.get_temp_file('results.json')
158136
run_scan_click(['--system-package', test_dir, '--json-pp', result_file])
159-
check_json_scan(expected_file, result_file, regen=regen)
137+
check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES)

0 commit comments

Comments
 (0)