diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-04-22 19:31:26 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-04-22 23:32:52 +0800 |
commit | bafbc3385e4fb3c048b3daa61ff2807a88f5b2e1 (patch) | |
tree | 4191c628d1657122f1b1406b3dd8817f0cd79e87 | |
parent | 771fc77eb3f3e0d43471c6bde39a194bb17affbb (diff) | |
download | cryptography-bafbc3385e4fb3c048b3daa61ff2807a88f5b2e1.tar.gz cryptography-bafbc3385e4fb3c048b3daa61ff2807a88f5b2e1.tar.bz2 cryptography-bafbc3385e4fb3c048b3daa61ff2807a88f5b2e1.zip |
Added _REASON
-rw-r--r-- | cryptography/hazmat/backends/multibackend.py | 3 | ||||
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py index 24a7a357..981a60bd 100644 --- a/cryptography/hazmat/backends/multibackend.py +++ b/cryptography/hazmat/backends/multibackend.py @@ -170,4 +170,5 @@ class MultiBackend(object): return b.create_cmac_ctx(algorithm) except UnsupportedAlgorithm: pass - raise UnsupportedAlgorithm("This backend does not support CMAC") + raise UnsupportedAlgorithm("This backend does not support CMAC", + _Reasons.UNSUPPORTED_CIPHER) diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index 2fa9f758..d8c09bd7 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 @@ -120,7 +118,7 @@ class DummyCMACBackend(object): def create_cmac_ctx(self, algorithm): if not self.cmac_algorithm_supported(algorithm): - raise UnsupportedAlgorithm("") + raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER) class TestMultiBackend(object): @@ -252,5 +250,5 @@ class TestMultiBackend(object): cmac.CMAC(algorithms.AES(fake_key), backend) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cmac.CMAC(algorithms.TripleDES(fake_key), backend) |