aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_hashes.py
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-10-18 19:21:27 -0700
committerDonald Stufft <donald@stufft.io>2013-10-18 19:21:27 -0700
commita3011beae965fde326d4977d850b2aaa9c7b216e (patch)
tree59095660e7061e238847c3e076d2d115ac716b2f /tests/primitives/test_hashes.py
parent90d2a77af90e9ed68125668e59b4d1f250938aec (diff)
parent3b7730cf90c6a5114391d2d5a2ccc1cdb448da9e (diff)
downloadcryptography-a3011beae965fde326d4977d850b2aaa9c7b216e.tar.gz
cryptography-a3011beae965fde326d4977d850b2aaa9c7b216e.tar.bz2
cryptography-a3011beae965fde326d4977d850b2aaa9c7b216e.zip
Merge pull request #123 from reaperhulk/hash-saga-sha1
Hash Saga Part 3 (API changes + SHA1)
Diffstat (limited to 'tests/primitives/test_hashes.py')
-rw-r--r--tests/primitives/test_hashes.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/primitives/test_hashes.py b/tests/primitives/test_hashes.py
new file mode 100644
index 00000000..4ad5c89a
--- /dev/null
+++ b/tests/primitives/test_hashes.py
@@ -0,0 +1,28 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import absolute_import, division, print_function
+
+from cryptography.primitives import hashes
+
+from .utils import generate_base_hash_test
+
+
+class TestSHA1(object):
+ test_SHA1 = generate_base_hash_test(
+ hashes.SHA1,
+ digest_size=20,
+ block_size=64,
+ only_if=lambda api: api.supports_hash(hashes.SHA1),
+ skip_message="Does not support SHA1",
+ )