diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-03-26 20:26:49 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-03-27 12:53:55 +0000 |
commit | 4c1401a3745af97fcd398ff5b7f0dcb94f5292a0 (patch) | |
tree | 5e9a953a04398bea99b95e07044eb917c28f56b3 /tests/hazmat/primitives/test_block.py | |
parent | f33ccfcc8e611359a65235d72423fc9c62b438da (diff) | |
download | cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.gz cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.tar.bz2 cryptography-4c1401a3745af97fcd398ff5b7f0dcb94f5292a0.zip |
Update tests and raise sites
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r-- | tests/hazmat/primitives/test_block.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py index e9ea7fb0..68d6c849 100644 --- a/tests/hazmat/primitives/test_block.py +++ b/tests/hazmat/primitives/test_block.py @@ -18,7 +18,9 @@ import binascii import pytest from cryptography import utils -from cryptography.exceptions import AlreadyFinalized, UnsupportedAlgorithm +from cryptography.exceptions import ( + AlreadyFinalized, _Reasons +) from cryptography.hazmat.primitives import interfaces from cryptography.hazmat.primitives.ciphers import ( Cipher, algorithms, modes @@ -27,6 +29,7 @@ from cryptography.hazmat.primitives.ciphers import ( from .utils import ( generate_aead_exception_test, generate_aead_tag_exception_test ) +from ...utils import raises_unsupported_algorithm @utils.register_interface(interfaces.Mode) @@ -114,10 +117,10 @@ class TestCipherContext(object): cipher = Cipher( DummyCipher(), mode, backend ) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.decryptor() def test_incorrectly_padded(self, backend): |