aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_block.py8
-rw-r--r--tests/hazmat/primitives/test_hashes.py4
-rw-r--r--tests/hazmat/primitives/test_hmac.py4
-rw-r--r--tests/hazmat/primitives/test_pbkdf2hmac.py4
4 files changed, 9 insertions, 11 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index f758ffaa..8ff00fd9 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -18,9 +18,7 @@ import binascii
import pytest
from cryptography import utils
-from cryptography.exceptions import (
- UnsupportedAlgorithm, AlreadyFinalized,
-)
+from cryptography.exceptions import UnsupportedCipher, AlreadyFinalized
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers import (
Cipher, algorithms, modes
@@ -116,10 +114,10 @@ class TestCipherContext(object):
cipher = Cipher(
DummyCipher(), mode, backend
)
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedCipher):
cipher.encryptor()
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedCipher):
cipher.decryptor()
def test_incorrectly_padded(self, backend):
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py
index 9ca2feee..fc53d635 100644
--- a/tests/hazmat/primitives/test_hashes.py
+++ b/tests/hazmat/primitives/test_hashes.py
@@ -20,7 +20,7 @@ import pytest
import six
from cryptography import utils
-from cryptography.exceptions import AlreadyFinalized, UnsupportedAlgorithm
+from cryptography.exceptions import AlreadyFinalized, UnsupportedHash
from cryptography.hazmat.primitives import hashes, interfaces
from .utils import generate_base_hash_test
@@ -65,7 +65,7 @@ class TestHashContext(object):
h.finalize()
def test_unsupported_hash(self, backend):
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedHash):
hashes.Hash(UnsupportedDummyHash(), backend)
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py
index dd9cdaab..88bed52c 100644
--- a/tests/hazmat/primitives/test_hmac.py
+++ b/tests/hazmat/primitives/test_hmac.py
@@ -21,7 +21,7 @@ import six
from cryptography import utils
from cryptography.exceptions import (
- AlreadyFinalized, UnsupportedAlgorithm, InvalidSignature
+ AlreadyFinalized, UnsupportedHash, InvalidSignature
)
from cryptography.hazmat.primitives import hashes, hmac, interfaces
@@ -102,5 +102,5 @@ class TestHMAC(object):
h.verify(six.u(''))
def test_unsupported_hash(self, backend):
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedHash):
hmac.HMAC(b"key", UnsupportedDummyHash(), backend)
diff --git a/tests/hazmat/primitives/test_pbkdf2hmac.py b/tests/hazmat/primitives/test_pbkdf2hmac.py
index 6ad225a8..f895935b 100644
--- a/tests/hazmat/primitives/test_pbkdf2hmac.py
+++ b/tests/hazmat/primitives/test_pbkdf2hmac.py
@@ -18,7 +18,7 @@ import six
from cryptography import utils
from cryptography.exceptions import (
- InvalidKey, UnsupportedAlgorithm, AlreadyFinalized
+ InvalidKey, UnsupportedHash, AlreadyFinalized
)
from cryptography.hazmat.primitives import hashes, interfaces
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
@@ -48,7 +48,7 @@ class TestPBKDF2HMAC(object):
kdf.verify(b"password", key)
def test_unsupported_algorithm(self):
- with pytest.raises(UnsupportedAlgorithm):
+ with pytest.raises(UnsupportedHash):
PBKDF2HMAC(DummyHash(), 20, b"salt", 10, default_backend())
def test_invalid_key(self):