diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-12-06 14:26:08 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-12-06 14:26:08 -0800 |
commit | b5c4891e0c2e30118641092aff975e8d0e63cbab (patch) | |
tree | b6209797e16ed81a5021fa6172e47ce2ebd94e1d /tests/hazmat/primitives/test_utils.py | |
parent | 07c36baec6ee7d4a89b3cbe18a37b9e5cbe48f64 (diff) | |
parent | a07925a154e2b28db30499c5a3cf40fedc451d10 (diff) | |
download | cryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.tar.gz cryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.tar.bz2 cryptography-b5c4891e0c2e30118641092aff975e8d0e63cbab.zip |
Merge pull request #285 from reaperhulk/fix-282
raise ValueErrors when supplying/not supplying tags for GCM
Diffstat (limited to 'tests/hazmat/primitives/test_utils.py')
-rw-r--r-- | tests/hazmat/primitives/test_utils.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/test_utils.py b/tests/hazmat/primitives/test_utils.py index ebb8b5c4..c39364c7 100644 --- a/tests/hazmat/primitives/test_utils.py +++ b/tests/hazmat/primitives/test_utils.py @@ -3,7 +3,7 @@ import pytest from .utils import ( base_hash_test, encrypt_test, hash_test, long_string_hash_test, base_hmac_test, hmac_test, stream_encryption_test, aead_test, - aead_exception_test, + aead_exception_test, aead_tag_exception_test, ) @@ -29,7 +29,7 @@ class TestAEADTest(object): assert exc_info.value.args[0] == "message!" -class TestAEADFinalizeTest(object): +class TestAEADExceptionTest(object): def test_skips_if_only_if_returns_false(self): with pytest.raises(pytest.skip.Exception) as exc_info: aead_exception_test( @@ -40,6 +40,17 @@ class TestAEADFinalizeTest(object): assert exc_info.value.args[0] == "message!" +class TestAEADTagExceptionTest(object): + def test_skips_if_only_if_returns_false(self): + with pytest.raises(pytest.skip.Exception) as exc_info: + aead_tag_exception_test( + None, None, None, + only_if=lambda backend: False, + 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: |