From 976945d4078bcd16eb5a95526e6b26ace7b19bd3 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Tue, 1 Apr 2014 12:04:44 +0100 Subject: Add _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM --- tests/hazmat/backends/test_multibackend.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/hazmat/backends/test_multibackend.py') diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index b7bcaf69..c91cb471 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -179,13 +179,19 @@ class TestMultiBackend(object): padding.PKCS1v15(), hashes.MD5()) backend = MultiBackend([]) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): backend.generate_rsa_private_key(key_size=1024, public_exponent=3) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): backend.create_rsa_signature_ctx("private_key", padding.PKCS1v15(), hashes.MD5()) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): backend.create_rsa_verification_ctx( "public_key", "sig", padding.PKCS1v15(), hashes.MD5()) -- cgit v1.2.3 From df16f4a573d0d9a81236818c79032f4c12ffec00 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Tue, 1 Apr 2014 15:00:00 +0100 Subject: fix pep8 errors --- tests/hazmat/backends/test_multibackend.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/hazmat/backends/test_multibackend.py') diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index c91cb471..f0be72b2 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -13,8 +13,6 @@ from __future__ import absolute_import, division, print_function -import pytest - from cryptography import utils from cryptography.exceptions import ( UnsupportedAlgorithm, _Reasons -- cgit v1.2.3