diff options
author | Dimitry <dimitry@ethereum.org> | 2018-09-26 19:59:17 +0800 |
---|---|---|
committer | Dimitry <dimitry@ethereum.org> | 2018-09-28 04:37:33 +0800 |
commit | 1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e (patch) | |
tree | 1e2f11b9cfcf5f9731413d74133d8c3c1e20c907 | |
parent | fafb8a88abd431eedd85167445ccafbc095eed7a (diff) | |
download | tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar.gz tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar.bz2 tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar.lz tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar.xz tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.tar.zst tangerine-tests-1d25604dd0f8a4f9337d32c22bac9c6bf5cc115e.zip |
support hash of the .yml test
-rwxr-xr-x | test.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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() |