aboutsummaryrefslogtreecommitdiff
path: root/test/unit/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/utils.py')
-rw-r--r--test/unit/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/utils.py b/test/unit/utils.py
index a61e215..255f89d 100644
--- a/test/unit/utils.py
+++ b/test/unit/utils.py
@@ -27,9 +27,12 @@ Various functions and objects that can be reused between unit tests
from hashlib import sha256
+def make_hash_key(file_contents):
+ return f'sha256-{sha256(file_contents.encode()).digest().hex()}'
+
def sample_file(contents):
return {
- 'hash_key': f'sha256-{sha256(contents.encode()).digest().hex()}',
+ 'hash_key': make_hash_key(contents),
'contents': contents
}