aboutsummaryrefslogtreecommitdiffstats
path: root/tests/primitives/test_utils.py
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2013-10-18 20:00:20 -0700
committerDonald Stufft <donald@stufft.io>2013-10-18 20:00:20 -0700
commit1494e3e1ffb192b9c55d200a6346879ca2fe1a8b (patch)
tree666e3ccb3978d1eb915516937e2fe54127c43649 /tests/primitives/test_utils.py
parent617c0c7e6f89271373f3f15ee05d16c80c8bdd5e (diff)
parentc179407406f0ef5c2b7b5b6316521408ba3803b3 (diff)
downloadcryptography-1494e3e1ffb192b9c55d200a6346879ca2fe1a8b.tar.gz
cryptography-1494e3e1ffb192b9c55d200a6346879ca2fe1a8b.tar.bz2
cryptography-1494e3e1ffb192b9c55d200a6346879ca2fe1a8b.zip
Merge pull request #125 from reaperhulk/hash-saga-ripeness
Hash Saga Part 5 (RIPEMD160 support)
Diffstat (limited to 'tests/primitives/test_utils.py')
-rw-r--r--tests/primitives/test_utils.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/primitives/test_utils.py b/tests/primitives/test_utils.py
index 43ec8a71..9888309e 100644
--- a/tests/primitives/test_utils.py
+++ b/tests/primitives/test_utils.py
@@ -1,6 +1,7 @@
import pytest
-from .utils import encrypt_test, hash_test, base_hash_test
+from .utils import (base_hash_test, encrypt_test, hash_test,
+ long_string_hash_test)
class TestEncryptTest(object):
@@ -34,3 +35,14 @@ class TestBaseHashTest(object):
skip_message="message!"
)
assert exc_info.value.args[0] == "message!"
+
+
+class TestLongHashTest(object):
+ def test_skips_if_only_if_returns_false(self):
+ with pytest.raises(pytest.skip.Exception) as exc_info:
+ long_string_hash_test(
+ None, None, None,
+ only_if=lambda api: False,
+ skip_message="message!"
+ )
+ assert exc_info.value.args[0] == "message!"