diff options
| author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-20 21:27:00 -0600 | 
|---|---|---|
| committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-11-29 17:19:45 -0600 | 
| commit | 22e80cb96e034679750a38702aaa55e30da05f69 (patch) | |
| tree | a8fa871f152c83c03033f1dab8fed319eb3ec239 /tests/hazmat/primitives/test_utils.py | |
| parent | bdb6debe4a9a3ccba6648c56028f849c0e5b6a12 (diff) | |
| download | cryptography-22e80cb96e034679750a38702aaa55e30da05f69.tar.gz cryptography-22e80cb96e034679750a38702aaa55e30da05f69.tar.bz2 cryptography-22e80cb96e034679750a38702aaa55e30da05f69.zip | |
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..f286e02d 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_use_after_finalize_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_use_after_finalize_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: | 
