From ae62fd3a479bd0caeffec97741318f2c6a15a234 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 1 Mar 2014 09:43:28 -0800 Subject: Update tests as well --- tests/hazmat/primitives/twofactor/test_hotp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py index 7c584271..fc74ee7f 100644 --- a/tests/hazmat/primitives/twofactor/test_hotp.py +++ b/tests/hazmat/primitives/twofactor/test_hotp.py @@ -15,7 +15,7 @@ import os import pytest -from cryptography.exceptions import InvalidToken, UnsupportedAlgorithm +from cryptography.exceptions import InvalidToken from cryptography.hazmat.primitives.twofactor.hotp import HOTP from cryptography.hazmat.primitives import hashes from tests.utils import load_vectors_from_file, load_nist_vectors @@ -46,7 +46,7 @@ class TestHOTP(object): def test_invalid_algorithm(self, backend): secret = os.urandom(16) - with pytest.raises(UnsupportedAlgorithm): + with pytest.raises(ValueError): HOTP(secret, 6, MD5(), backend) @pytest.mark.parametrize("params", vectors) -- cgit v1.2.3 From 9b1a82e42bdd546220225430aa06e3b732fb0155 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 1 Mar 2014 09:57:25 -0800 Subject: Switch to TypeError --- tests/hazmat/primitives/twofactor/test_hotp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/twofactor/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py index fc74ee7f..4c726b77 100644 --- a/tests/hazmat/primitives/twofactor/test_hotp.py +++ b/tests/hazmat/primitives/twofactor/test_hotp.py @@ -46,7 +46,7 @@ class TestHOTP(object): def test_invalid_algorithm(self, backend): secret = os.urandom(16) - with pytest.raises(ValueError): + with pytest.raises(TypeError): HOTP(secret, 6, MD5(), backend) @pytest.mark.parametrize("params", vectors) -- cgit v1.2.3