summaryrefslogtreecommitdiff
path: root/utils/gen-hash-tests.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-25 19:00:31 +0200
committerMichał Górny <mgorny@gentoo.org>2017-10-25 19:00:31 +0200
commitbd1022e46a1933f634a27b1ed7632054f7f89a4f (patch)
tree51a26b0db739f1606509204bccb12f2c5e96b324 /utils/gen-hash-tests.py
parente79212d5c2d6f3ed3213c80e10e36c5043c3a3dd (diff)
downloadgemato-bd1022e46a1933f634a27b1ed7632054f7f89a4f.tar.gz
Fix file suffix for gen-hash-tests
Diffstat (limited to 'utils/gen-hash-tests.py')
-rwxr-xr-xutils/gen-hash-tests.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/utils/gen-hash-tests.py b/utils/gen-hash-tests.py
deleted file mode 100755
index 9999af0..0000000
--- a/utils/gen-hash-tests.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-test_string='The quick brown fox jumps over the lazy dog'
-
-if [[ ${#} -lt 1 ]]; then
- echo "Usage: ${0} <hashlib-name> [<program-to-use>]"
- exit 1
-fi
-
-algo=${1}
-algo_sum=${2:-${algo}sum}
-
-empty=$(printf '' | ${algo_sum} | cut -d' ' -f1)
-str=$(printf '%s' "${test_string}" | ${algo_sum} | cut -d' ' -f1)
-
-cat <<_EOF_
-
- def test_${algo}(self):
- try:
- self.assertEqual(hash_bytes(TEST_STRING, '${algo}'),
- '${str}')
- except UnsupportedHash:
- raise unittest.SkipTest('hash not supported')
-
- def test_${algo}_empty(self):
- try:
- self.assertEqual(hash_bytes(b'', '${algo}'),
- '${empty}')
- except UnsupportedHash:
- raise unittest.SkipTest('hash not supported')
-_EOF_