From 59518a0ccc814fd8ef4d1e6fce6e2858a34a7348 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 5 Mar 2016 13:57:16 -0500 Subject: Un-double the test doubles --- tests/hazmat/backends/test_commoncrypto.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'tests/hazmat/backends/test_commoncrypto.py') 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() -- cgit v1.2.3