Skip to content

Commit 3ce9efc

Browse files
Add formattedcode tests with yaml encoded strings
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent c77e724 commit 3ce9efc

File tree

11 files changed

+5875
-0
lines changed

11 files changed

+5875
-0
lines changed

src/scancode/cli_test_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ def check_jsonlines_scan(
340340
regen=False,
341341
remove_file_date=False,
342342
check_headers=False,
343+
remove_uuid=True,
343344
):
344345
"""
345346
Check the scan result_file JSON Lines results against the expected_file
@@ -352,6 +353,9 @@ def check_jsonlines_scan(
352353
with io.open(result_file, encoding='utf-8') as res:
353354
results = [json.loads(line) for line in res]
354355

356+
if remove_uuid:
357+
for result in results:
358+
result = remove_uuid_from_scan(result)
355359
streamline_jsonlines_scan(results, remove_file_date)
356360

357361
if regen:
@@ -360,6 +364,9 @@ def check_jsonlines_scan(
360364

361365
with io.open(expected_file, encoding='utf-8') as res:
362366
expected = json.load(res)
367+
if remove_uuid:
368+
for result in results:
369+
result = remove_uuid_from_scan(result)
363370

364371
streamline_jsonlines_scan(expected, remove_file_date)
365372

0 commit comments

Comments
 (0)