diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-18 23:58:33 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-18 23:58:33 -0700 |
commit | 2984b3f8fb433b4cbe5ec6712886db32f597e8af (patch) | |
tree | f682add3b8906c8df68895d74ba278ad06f7099d /tests/primitives/test_utils.py | |
parent | 5762647e8d7f53ed9f4abed90626382b6c903ee2 (diff) | |
parent | c21f968301b0d4cc848ea554403e9d9239327803 (diff) | |
download | cryptography-2984b3f8fb433b4cbe5ec6712886db32f597e8af.tar.gz cryptography-2984b3f8fb433b4cbe5ec6712886db32f597e8af.tar.bz2 cryptography-2984b3f8fb433b4cbe5ec6712886db32f597e8af.zip |
Merge branch 'master' into bind-pkcs12
Conflicts:
cryptography/bindings/openssl/api.py
Diffstat (limited to 'tests/primitives/test_utils.py')
-rw-r--r-- | tests/primitives/test_utils.py | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/primitives/test_utils.py b/tests/primitives/test_utils.py index 4666ece7..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 +from .utils import (base_hash_test, encrypt_test, hash_test, + long_string_hash_test) class TestEncryptTest(object): @@ -12,3 +13,36 @@ class TestEncryptTest(object): skip_message="message!" ) assert exc_info.value.args[0] == "message!" + + +class TestHashTest(object): + def test_skips_if_only_if_returns_false(self): + with pytest.raises(pytest.skip.Exception) as exc_info: + hash_test( + None, None, None, + only_if=lambda api: False, + skip_message="message!" + ) + assert exc_info.value.args[0] == "message!" + + +class TestBaseHashTest(object): + def test_skips_if_only_if_returns_false(self): + with pytest.raises(pytest.skip.Exception) as exc_info: + base_hash_test( + None, None, None, None, + only_if=lambda api: False, + 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!" |