diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-09-22 21:10:03 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-09-22 21:10:03 -0400 |
commit | 7d994285bb868825dc06e1f7a87facc8cd73f88d (patch) | |
tree | 6fddbeb26cb6118d933395c69b2c64a617be85ad | |
parent | 3d971a6b95000f7575d4508c0bc1eee93138e8f6 (diff) | |
download | cryptography-7d994285bb868825dc06e1f7a87facc8cd73f88d.tar.gz cryptography-7d994285bb868825dc06e1f7a87facc8cd73f88d.tar.bz2 cryptography-7d994285bb868825dc06e1f7a87facc8cd73f88d.zip |
fix up test coverage on multibackend
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index cc59a8d4..4d17cdb0 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -221,6 +221,9 @@ class TestMultiBackend(object): assert backend.cipher_supported( algorithms.AES(b"\x00" * 16), modes.CBC(b"\x00" * 16) ) + assert not backend.cipher_supported( + algorithms.TripleDES(b"\x00" * 16), modes.CBC(b"\x00" * 16) + ) cipher = Cipher( algorithms.AES(b"\x00" * 16), @@ -245,6 +248,7 @@ class TestMultiBackend(object): DummyHashBackend([hashes.MD5]) ]) assert backend.hash_supported(hashes.MD5()) + assert not backend.hash_supported(hashes.SHA256()) hashes.Hash(hashes.MD5(), backend=backend) @@ -256,6 +260,7 @@ class TestMultiBackend(object): DummyHMACBackend([hashes.MD5]) ]) assert backend.hmac_supported(hashes.MD5()) + assert not backend.hmac_supported(hashes.SHA256()) hmac.HMAC(b"", hashes.MD5(), backend=backend) @@ -381,8 +386,10 @@ class TestMultiBackend(object): fake_key = b"\x00" * 16 - assert backend.cmac_algorithm_supported( - algorithms.AES(fake_key)) is True + assert backend.cmac_algorithm_supported(algorithms.AES(fake_key)) + assert not backend.cmac_algorithm_supported( + algorithms.TripleDES(fake_key) + ) cmac.CMAC(algorithms.AES(fake_key), backend) |