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/primitives/test_block.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/primitives/test_block.py')
| -rw-r--r-- | tests/hazmat/primitives/test_block.py | 18 | 
1 files changed, 2 insertions, 16 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py index 1b3fc1cb..4f7e63bf 100644 --- a/tests/hazmat/primitives/test_block.py +++ b/tests/hazmat/primitives/test_block.py @@ -8,7 +8,6 @@ import binascii  import pytest -from cryptography import utils  from cryptography.exceptions import (      AlreadyFinalized, _Reasons  ) @@ -20,23 +19,10 @@ from cryptography.hazmat.primitives.ciphers import (  from .utils import (      generate_aead_exception_test, generate_aead_tag_exception_test  ) +from ...doubles import DummyCipherAlgorithm, DummyMode  from ...utils import raises_unsupported_algorithm -@utils.register_interface(modes.Mode) -class DummyMode(object): -    name = "dummy-mode" - -    def validate_for_algorithm(self, algorithm): -        pass - - -@utils.register_interface(base.CipherAlgorithm) -class DummyCipher(object): -    name = "dummy-cipher" -    key_size = None - -  @pytest.mark.requires_backend_interface(interface=CipherBackend)  class TestCipher(object):      def test_creates_encryptor(self, backend): @@ -107,7 +93,7 @@ class TestCipherContext(object):      @pytest.mark.parametrize("mode", [DummyMode(), None])      def test_nonexistent_cipher(self, backend, mode):          cipher = Cipher( -            DummyCipher(), mode, backend +            DummyCipherAlgorithm(), mode, backend          )          with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):              cipher.encryptor()  | 
