aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorDavid Reid <dreid@dreid.org>2013-11-02 23:16:33 -0700
committerDavid Reid <dreid@dreid.org>2013-11-02 23:16:33 -0700
commitd4e98f8d552843c371600c88e1cdab94678081a9 (patch)
tree5699ddce355497cbb6890e9c55013d64e7cfc9d8 /tests/hazmat
parent178f6f19a611219f27a0b4e1837134b308de08d2 (diff)
parent3949f1171084c2e1cfe43f638857ea0e0f8f246d (diff)
downloadcryptography-d4e98f8d552843c371600c88e1cdab94678081a9.tar.gz
cryptography-d4e98f8d552843c371600c88e1cdab94678081a9.tar.bz2
cryptography-d4e98f8d552843c371600c88e1cdab94678081a9.zip
Merge pull request #215 from alex/unsupported-cipher
Document and implement the public API for when the backend doesn't suppo...
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/primitives/test_block.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index e0ed6697..dd9c54c9 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -17,6 +17,7 @@ import binascii
import pytest
+from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.block import BlockCipher, ciphers, modes
@@ -84,3 +85,13 @@ class TestBlockCipherContext(object):
assert len(pt) == 80
assert pt == b"a" * 80
decryptor.finalize()
+
+ def test_nonexistant_cipher(self, backend):
+ cipher = BlockCipher(
+ object(), object(), backend
+ )
+ with pytest.raises(UnsupportedAlgorithm):
+ cipher.encryptor()
+
+ with pytest.raises(UnsupportedAlgorithm):
+ cipher.decryptor()