diff options
Diffstat (limited to 'tests/primitives/test_utils.py')
-rw-r--r-- | tests/primitives/test_utils.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/primitives/test_utils.py b/tests/primitives/test_utils.py index 4666ece7..43ec8a71 100644 --- a/tests/primitives/test_utils.py +++ b/tests/primitives/test_utils.py @@ -1,6 +1,6 @@ import pytest -from .utils import encrypt_test +from .utils import encrypt_test, hash_test, base_hash_test class TestEncryptTest(object): @@ -12,3 +12,25 @@ 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!" |