From dd8de100acda322f2124c58163ecde6f1b37d61d Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 11 Jan 2022 15:43:40 +0100 Subject: add missing payload_create test and styling --- test/unit/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/unit/utils.py') 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 } -- cgit v1.2.3