aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-06 19:43:53 -0430
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-03-06 19:43:53 -0430
commit792eef345d138a0d0eff5df923f8218376e78621 (patch)
tree479a7090ede017536fbb5ebb1dfe76ddb1917d7a /tests/hazmat/backends/test_openssl.py
parentd932f662d5e2659cb79a6aeb5aa1bdeffa2c067e (diff)
parent2a69b48f6a8e3a287a9fb1fa7728f01bde765a1b (diff)
downloadcryptography-792eef345d138a0d0eff5df923f8218376e78621.tar.gz
cryptography-792eef345d138a0d0eff5df923f8218376e78621.tar.bz2
cryptography-792eef345d138a0d0eff5df923f8218376e78621.zip
Merge pull request #747 from alex/exception-heirarchy-refactor
Try to use more specific exceptions in places.
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r--tests/hazmat/backends/test_openssl.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 42c1b395..c6792185 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -14,7 +14,9 @@
import pytest
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, InternalError
+from cryptography.exceptions import (
+ UnsupportedCipher, UnsupportedHash, InternalError
+)
from cryptography.hazmat.backends.openssl.backend import backend, Backend
from cryptography.hazmat.primitives import interfaces, hashes
from cryptography.hazmat.primitives.ciphers import Cipher
@@ -68,7 +70,7 @@ class TestOpenSSL(object):
cipher = Cipher(
DummyCipher(), mode, backend=b,
)
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedCipher):
cipher.encryptor()
def test_consume_errors(self):
@@ -130,7 +132,7 @@ class TestOpenSSL(object):
def test_derive_pbkdf2_raises_unsupported_on_old_openssl(self):
if backend.pbkdf2_hmac_supported(hashes.SHA256()):
pytest.skip("Requires an older OpenSSL")
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedHash):
backend.derive_pbkdf2_hmac(hashes.SHA256(), 10, b"", 1000, b"")
# This test is not in the next class because to check if it's really