Revision fd38a0e1
Added by koszko over 1 year ago
src/test/test_hydrilla_builder.py | ||
---|---|---|
298 | 298 |
set([path.name for path in dstdir.iterdir()]) |
299 | 299 |
|
300 | 300 |
# Verify files under 'file/' |
301 |
file_dir = dstdir / 'file' |
|
301 |
file_dir = dstdir / 'file' / 'sha256'
|
|
302 | 302 |
|
303 | 303 |
for fn in settings.dist_filenames: |
304 |
dist_file_path = file_dir / f'sha256-{settings.sha256_hashes[fn]}'
|
|
304 |
dist_file_path = file_dir / settings.sha256_hashes[fn]
|
|
305 | 305 |
assert dist_file_path.is_file() |
306 | 306 |
|
307 |
with open(dist_file_path, 'rb') as file_handle: |
|
308 |
assert file_handle.read() == settings.contents[fn] |
|
307 |
assert dist_file_path.read_bytes() == settings.contents[fn] |
|
309 | 308 |
|
310 | 309 |
sha256_hashes_set = set([settings.sha256_hashes[fn] |
311 | 310 |
for fn in settings.dist_filenames]) |
... | ... | |
313 | 312 |
spdx_report_sha256 = None |
314 | 313 |
|
315 | 314 |
for path in file_dir.iterdir(): |
316 |
assert path.name.startswith('sha256-') |
|
317 |
if path.name[7:] in sha256_hashes_set: |
|
315 |
if path.name in sha256_hashes_set: |
|
318 | 316 |
continue |
319 | 317 |
|
320 | 318 |
assert spdx_report_sha256 is None and settings.report_spdx_included |
... | ... | |
323 | 321 |
spdx_contents = file_handle.read() |
324 | 322 |
|
325 | 323 |
spdx_report_sha256 = sha256(spdx_contents.encode()).digest().hex() |
326 |
assert spdx_report_sha256 == path.name[7:]
|
|
324 |
assert spdx_report_sha256 == path.name |
|
327 | 325 |
|
328 | 326 |
for fn in settings.src_filenames: |
329 | 327 |
if not any([n in fn.lower() for n in ('license', 'reuse')]): |
Also available in: Unified diff
change file path format
From now on we'll be using format 'file/sha256/' instead of 'file/sha256-'.