diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-22 12:45:07 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-10-22 12:45:07 -0500 |
commit | b2c94fd22e0da4159be8c98dd32917bdf9cfb504 (patch) | |
tree | 8f6c626374e69073584c07535bef326683f92687 | |
parent | f6cf956321ad99fe5bf071eb8832dbf2192c0ff5 (diff) | |
download | cryptography-b2c94fd22e0da4159be8c98dd32917bdf9cfb504.tar.gz cryptography-b2c94fd22e0da4159be8c98dd32917bdf9cfb504.tar.bz2 cryptography-b2c94fd22e0da4159be8c98dd32917bdf9cfb504.zip |
verify that encryptor/decryptor returns CipherContext compliant interface
-rw-r--r-- | tests/primitives/test_block.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/primitives/test_block.py b/tests/primitives/test_block.py index 8e429085..5e147a79 100644 --- a/tests/primitives/test_block.py +++ b/tests/primitives/test_block.py @@ -17,6 +17,7 @@ import binascii import pytest +from cryptography.primitives import interfaces from cryptography.primitives.block import BlockCipher, ciphers, modes @@ -32,14 +33,14 @@ class TestBlockCipher(object): ciphers.AES(binascii.unhexlify(b"0" * 32)), modes.CBC(binascii.unhexlify(b"0" * 32)) ) - assert cipher.encryptor() is not None + assert isinstance(cipher.encryptor(), interfaces.CipherContext) def test_creates_decryptor(self): cipher = BlockCipher( ciphers.AES(binascii.unhexlify(b"0" * 32)), modes.CBC(binascii.unhexlify(b"0" * 32)) ) - assert cipher.decryptor() is not None + assert isinstance(cipher.decryptor(), interfaces.CipherContext) class TestBlockCipherContext(object): |