aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_ciphers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/primitives/test_ciphers.py')
-rw-r--r--tests/hazmat/primitives/test_ciphers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ciphers.py b/tests/hazmat/primitives/test_ciphers.py
index d9f83535..bd9625e9 100644
--- a/tests/hazmat/primitives/test_ciphers.py
+++ b/tests/hazmat/primitives/test_ciphers.py
@@ -17,9 +17,12 @@ import binascii
import pytest
+from cryptography.exceptions import UnsupportedInterface
+from cryptography.hazmat.primitives import ciphers
from cryptography.hazmat.primitives.ciphers.algorithms import (
AES, Camellia, TripleDES, Blowfish, ARC4, CAST5, IDEA
)
+from cryptography.hazmat.primitives.ciphers.modes import ECB
class TestAES(object):
@@ -120,3 +123,10 @@ class TestIDEA(object):
def test_invalid_key_size(self):
with pytest.raises(ValueError):
IDEA(b"\x00" * 17)
+
+
+def test_invalid_backend():
+ pretend_backend = object()
+
+ with pytest.raises(UnsupportedInterface):
+ ciphers.Cipher(AES(b"AAAAAAAAAAAAAAAA"), ECB, pretend_backend)