aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hydrilla_builder.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-09 15:30:26 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-09 15:30:26 +0100
commitfd38a0e1dd3dbe0de365e938ac3dca3bee4320dd (patch)
tree18caacf2b9f331c0b986d34e0c12641027342876 /src/test/test_hydrilla_builder.py
parent456ad6c0760329943f4f8e2b2b7dc0e260cba128 (diff)
downloadhydrilla-builder-fd38a0e1dd3dbe0de365e938ac3dca3bee4320dd.tar.gz
hydrilla-builder-fd38a0e1dd3dbe0de365e938ac3dca3bee4320dd.zip
change file path format
From now on we'll be using format 'file/sha256/<hash>' instead of 'file/sha256-<hash>'.
Diffstat (limited to 'src/test/test_hydrilla_builder.py')
-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')]):