Skip to content

Commit d7e8318

Browse files
committed
Add test test_output_spdx_tv_sh1_of_empty_file
Signed-off-by: Marc-Etienne Vargenau <[email protected]>
1 parent e0af1d3 commit d7e8318

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ The following organizations or individuals have contributed to ScanCode:
4444
- Lemo Shi @lemoshi
4545
- Li Ha @linexb
4646
- Mankaran Singh @MankaranSingh
47+
- Marc-Etienne Vargenau @vargenau
4748
- Martin Petkov @MartinPetkov
4849
- Maximilian Huber @maxhbr
4950
- Michael Herzog @mjherzog

tests/formattedcode/test_output_spdx.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,18 @@ def test_output_spdx_rdf_can_handle_non_ascii_paths():
346346
results = res.read()
347347
assert 'han/据.svg' in results
348348

349-
350349
def test_output_spdx_tv_can_handle_non_ascii_paths():
351350
test_file = test_env.get_test_loc('spdx/unicode.json')
352351
result_file = test_env.get_temp_file(extension='spdx', file_name='test_spdx')
353352
run_scan_click(['--from-json', test_file, '--spdx-tv', result_file])
354353
with io.open(result_file, encoding='utf-8') as res:
355354
results = res.read()
356355
assert 'han/据.svg' in results
356+
357+
def test_output_spdx_tv_sh1_of_empty_file():
358+
test_dir = test_env.get_test_loc('spdx/empty/scan/somefile')
359+
result_file = test_env.get_temp_file(extension='spdx', file_name='test_spdx')
360+
run_scan_click([test_dir, '-clip', '--spdx-tv', result_file])
361+
with io.open(result_file, encoding='utf-8') as res:
362+
results = res.read()
363+
assert 'FileChecksum: SHA1: da39a3ee5e6b4b0d3255bfef95601890afd80709' in results

0 commit comments

Comments
 (0)