aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_block.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-13 13:30:30 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-13 13:30:30 -0800
commit34511c697f6f17915b5fe5a58214bb38d779f4a8 (patch)
tree8a51d2a402472a8071e641107eda2ee037f83349 /tests/hazmat/primitives/test_block.py
parentc2cddd2b1f0bd935ed53ee49446e268d9bf874e7 (diff)
downloadcryptography-34511c697f6f17915b5fe5a58214bb38d779f4a8.tar.gz
cryptography-34511c697f6f17915b5fe5a58214bb38d779f4a8.tar.bz2
cryptography-34511c697f6f17915b5fe5a58214bb38d779f4a8.zip
Use AlreadyFinalized for symmetric ciphers
Diffstat (limited to 'tests/hazmat/primitives/test_block.py')
-rw-r--r--tests/hazmat/primitives/test_block.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index 28f34478..938cff36 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -17,7 +17,7 @@ import binascii
import pytest
-from cryptography.exceptions import UnsupportedAlgorithm
+from cryptography.exceptions import UnsupportedAlgorithm, AlreadyFinalized
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciphers import (
Cipher, algorithms, modes
@@ -56,16 +56,16 @@ class TestCipherContext(object):
encryptor = cipher.encryptor()
encryptor.update(b"a" * 16)
encryptor.finalize()
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
encryptor.update(b"b" * 16)
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
encryptor.finalize()
decryptor = cipher.decryptor()
decryptor.update(b"a" * 16)
decryptor.finalize()
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
decryptor.update(b"b" * 16)
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
decryptor.finalize()
def test_unaligned_block_encryption(self, backend):