summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_hydrilla_builder.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/test/test_hydrilla_builder.py b/src/test/test_hydrilla_builder.py
index 0b6244f..f079d34 100644
--- a/src/test/test_hydrilla_builder.py
+++ b/src/test/test_hydrilla_builder.py
@@ -298,14 +298,13 @@ def test_build(tmpdir, prepare_source_example):
set([path.name for path in dstdir.iterdir()])
# Verify files under 'file/'
- file_dir = dstdir / 'file'
+ file_dir = dstdir / 'file' / 'sha256'
for fn in settings.dist_filenames:
- dist_file_path = file_dir / f'sha256-{settings.sha256_hashes[fn]}'
+ dist_file_path = file_dir / settings.sha256_hashes[fn]
assert dist_file_path.is_file()
- with open(dist_file_path, 'rb') as file_handle:
- assert file_handle.read() == settings.contents[fn]
+ assert dist_file_path.read_bytes() == settings.contents[fn]
sha256_hashes_set = set([settings.sha256_hashes[fn]
for fn in settings.dist_filenames])
@@ -313,8 +312,7 @@ def test_build(tmpdir, prepare_source_example):
spdx_report_sha256 = None
for path in file_dir.iterdir():
- assert path.name.startswith('sha256-')
- if path.name[7:] in sha256_hashes_set:
+ if path.name in sha256_hashes_set:
continue
assert spdx_report_sha256 is None and settings.report_spdx_included
@@ -323,7 +321,7 @@ def test_build(tmpdir, prepare_source_example):
spdx_contents = file_handle.read()
spdx_report_sha256 = sha256(spdx_contents.encode()).digest().hex()
- assert spdx_report_sha256 == path.name[7:]
+ assert spdx_report_sha256 == path.name
for fn in settings.src_filenames:
if not any([n in fn.lower() for n in ('license', 'reuse')]):