diff options
author | David Reid <dreid@dreid.org> | 2013-11-02 23:16:33 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-11-02 23:16:33 -0700 |
commit | d4e98f8d552843c371600c88e1cdab94678081a9 (patch) | |
tree | 5699ddce355497cbb6890e9c55013d64e7cfc9d8 /tests/hazmat | |
parent | 178f6f19a611219f27a0b4e1837134b308de08d2 (diff) | |
parent | 3949f1171084c2e1cfe43f638857ea0e0f8f246d (diff) | |
download | cryptography-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.py | 11 |
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() |