diff options
author | David Reid <dreid@dreid.org> | 2013-12-04 14:21:53 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-12-04 14:21:53 -0800 |
commit | 3029fe414a3dba0231a44e72ddfc398634c173de (patch) | |
tree | 4cc5e7a8933a6a916bbf7a2712df143d6e2ceb71 /tests/hazmat/primitives/test_utils.py | |
parent | bdb6debe4a9a3ccba6648c56028f849c0e5b6a12 (diff) | |
parent | 672843712d6b42404fea27a07a87b70d850cc0dd (diff) | |
download | cryptography-3029fe414a3dba0231a44e72ddfc398634c173de.tar.gz cryptography-3029fe414a3dba0231a44e72ddfc398634c173de.tar.bz2 cryptography-3029fe414a3dba0231a44e72ddfc398634c173de.zip |
Merge pull request #176 from reaperhulk/gcm-support
[WIP] GCM support
Diffstat (limited to 'tests/hazmat/primitives/test_utils.py')
-rw-r--r-- | tests/hazmat/primitives/test_utils.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_utils.py b/tests/hazmat/primitives/test_utils.py index cee0b20e..ebb8b5c4 100644 --- a/tests/hazmat/primitives/test_utils.py +++ b/tests/hazmat/primitives/test_utils.py @@ -2,7 +2,8 @@ import pytest from .utils import ( base_hash_test, encrypt_test, hash_test, long_string_hash_test, - base_hmac_test, hmac_test, stream_encryption_test + base_hmac_test, hmac_test, stream_encryption_test, aead_test, + aead_exception_test, ) @@ -17,6 +18,28 @@ class TestEncryptTest(object): assert exc_info.value.args[0] == "message!" +class TestAEADTest(object): + def test_skips_if_only_if_returns_false(self): + with pytest.raises(pytest.skip.Exception) as exc_info: + aead_test( + None, None, None, None, + only_if=lambda backend: False, + skip_message="message!" + ) + assert exc_info.value.args[0] == "message!" + + +class TestAEADFinalizeTest(object): + def test_skips_if_only_if_returns_false(self): + with pytest.raises(pytest.skip.Exception) as exc_info: + aead_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: |