ripemd160 support + long string hash test
* Note that the long string hash test for RIPEMD160 adds a vector in the
test. You can verify this vector (for b"a" * 1000000) on the RIPE
homepage: http://homes.esat.kuleuven.be/~bosselae/ripemd160.html
diff --git a/tests/primitives/test_utils.py b/tests/primitives/test_utils.py
index 43ec8a7..9888309 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 @@
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!"