From 1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e Mon Sep 17 00:00:00 2001 From: Dimitry Date: Wed, 26 Sep 2018 14:59:17 +0300 Subject: support hash of the .yml test --- test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index ff4bbdd38..03cc9f942 100755 --- a/test.py +++ b/test.py @@ -133,7 +133,12 @@ def validateTestFile(testFile): def hashFile(fname): with open(fname ,"rb") as f: k = sha3.keccak_256() - s = json.dumps(json.load(f), separators=(',', ':')) + if fname.endswith(".json"): + s = json.dumps(json.load(f), separators=(',', ':')) + elif fname.endswith(".yml"): + s = json.dumps(yaml.load(f), sort_keys=True, separators=(',', ':')) + else: + _die("Do not know how to hash:", fname) k.update(s.encode('utf-8')) return k.hexdigest() -- cgit v1.2.3