diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2013-12-21 16:29:45 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2013-12-22 10:48:01 +0000 |
commit | 35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2 (patch) | |
tree | 925805d60b56e0be6da8777de550c73c25f97d65 /tests/hazmat/primitives/test_block.py | |
parent | 9b9318d79ba5927603b120411d13b607938cae56 (diff) | |
download | cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.tar.gz cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.tar.bz2 cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.zip |
UnsupportedAlgorithm error messages for Ciphers
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r-- | tests/hazmat/primitives/test_block.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py index 02de3861..573f5633 100644 --- a/tests/hazmat/primitives/test_block.py +++ b/tests/hazmat/primitives/test_block.py @@ -31,9 +31,14 @@ from .utils import ( ) +@utils.register_interface(interfaces.Mode) +class DummyMode(object): + name = "dummy-mode" + + @utils.register_interface(interfaces.CipherAlgorithm) class DummyCipher(object): - pass + name = "dummy-cipher" class TestCipher(object): @@ -101,9 +106,10 @@ class TestCipherContext(object): assert pt == b"a" * 80 decryptor.finalize() - def test_nonexistent_cipher(self, backend): + @pytest.mark.parametrize("mode", [DummyMode(), None]) + def test_nonexistent_cipher(self, backend, mode): cipher = Cipher( - DummyCipher(), object(), backend + DummyCipher(), mode, backend ) with pytest.raises(UnsupportedAlgorithm): cipher.encryptor() |