diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-06 16:40:04 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-03-06 16:40:04 -0400 |
commit | 1c6155a9aa47399ef17f23a169bc1233cec1bec3 (patch) | |
tree | 3a51676fbd8fbe147f61088e3e64dad6a7654d6e /tests/hazmat/backends/test_commoncrypto.py | |
parent | 4a3741e0d3dbf962e3e55b973968f625e2a1f544 (diff) | |
parent | 53e7b24e1ff91de415d2f128b1463bea33b756a9 (diff) | |
download | cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.tar.gz cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.tar.bz2 cryptography-1c6155a9aa47399ef17f23a169bc1233cec1bec3.zip |
Merge pull request #2762 from alex/dedupe-doubles
Un-double the test doubles
Diffstat (limited to 'tests/hazmat/backends/test_commoncrypto.py')
-rw-r--r-- | tests/hazmat/backends/test_commoncrypto.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py index f7200016..2b730e93 100644 --- a/tests/hazmat/backends/test_commoncrypto.py +++ b/tests/hazmat/backends/test_commoncrypto.py @@ -6,23 +6,16 @@ from __future__ import absolute_import, division, print_function import pytest -from cryptography import utils from cryptography.exceptions import InternalError, _Reasons from cryptography.hazmat.backends import _available_backends -from cryptography.hazmat.primitives.ciphers import Cipher, CipherAlgorithm +from cryptography.hazmat.primitives.ciphers import Cipher from cryptography.hazmat.primitives.ciphers.algorithms import AES from cryptography.hazmat.primitives.ciphers.modes import CBC, GCM +from ...doubles import DummyCipherAlgorithm from ...utils import raises_unsupported_algorithm -@utils.register_interface(CipherAlgorithm) -class DummyCipher(object): - name = "dummy-cipher" - block_size = None - key_size = None - - @pytest.mark.skipif("commoncrypto" not in [i.name for i in _available_backends()], reason="CommonCrypto not available") @@ -55,7 +48,7 @@ class TestCommonCrypto(object): from cryptography.hazmat.backends.commoncrypto.backend import Backend b = Backend() cipher = Cipher( - DummyCipher(), GCM(b"fake_iv_here"), backend=b, + DummyCipherAlgorithm(), GCM(b"fake_iv_here"), backend=b, ) with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() |