From 7a489dbd116edd4ca5a6104b74748f3a4f712d15 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 22 Mar 2014 15:09:34 -0700 Subject: Fixed #809 -- switch back to always using UnsupportedAlgorithm --- tests/hazmat/primitives/test_hkdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/hazmat/primitives/test_hkdf.py') diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py index 367addc9..b3d412c5 100644 --- a/tests/hazmat/primitives/test_hkdf.py +++ b/tests/hazmat/primitives/test_hkdf.py @@ -18,7 +18,7 @@ import pytest import six from cryptography.exceptions import ( - AlreadyFinalized, InvalidKey, UnsupportedInterface + AlreadyFinalized, InvalidKey, UnsupportedAlgorithm ) from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.hkdf import HKDF @@ -152,5 +152,5 @@ class TestHKDF(object): def test_invalid_backend(): pretend_backend = object() - with pytest.raises(UnsupportedInterface): + with pytest.raises(UnsupportedAlgorithm): HKDF(hashes.SHA256(), 16, None, None, pretend_backend) -- cgit v1.2.3 From 4c1401a3745af97fcd398ff5b7f0dcb94f5292a0 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Wed, 26 Mar 2014 20:26:49 +0000 Subject: Update tests and raise sites --- tests/hazmat/primitives/test_hkdf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/hazmat/primitives/test_hkdf.py') diff --git a/tests/hazmat/primitives/test_hkdf.py b/tests/hazmat/primitives/test_hkdf.py index b3d412c5..2e3c0c3d 100644 --- a/tests/hazmat/primitives/test_hkdf.py +++ b/tests/hazmat/primitives/test_hkdf.py @@ -18,11 +18,13 @@ import pytest import six from cryptography.exceptions import ( - AlreadyFinalized, InvalidKey, UnsupportedAlgorithm + AlreadyFinalized, InvalidKey, _Reasons ) from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.kdf.hkdf import HKDF +from ...utils import raises_unsupported_algorithm + @pytest.mark.hmac class TestHKDF(object): @@ -152,5 +154,5 @@ class TestHKDF(object): def test_invalid_backend(): pretend_backend = object() - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.BACKEND_MISSING_INTERFACE): HKDF(hashes.SHA256(), 16, None, None, pretend_backend) -- cgit v1.2.3