summaryrefslogtreecommitdiff
path: root/test/unit/utils.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-01-11 15:43:40 +0100
committerWojtek Kosior <koszko@koszko.org>2022-01-11 15:43:40 +0100
commitdd8de100acda322f2124c58163ecde6f1b37d61d (patch)
treecbb73c92f04a83e259ea9b53ca653c6891970024 /test/unit/utils.py
parent19304cd1ae4e4ba4f6dcf4f1db14de1e4e70c250 (diff)
downloadbrowser-extension-dd8de100acda322f2124c58163ecde6f1b37d61d.tar.gz
browser-extension-dd8de100acda322f2124c58163ecde6f1b37d61d.zip
add missing payload_create test and styling
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
}