aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-04-25 22:31:44 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-04-25 22:31:44 +0100
commit575a7f5f93828c1dd133b420490be2183d71fe9c (patch)
tree23f0fdfc53b4d5edf2dccd0188276ddac1533046 /tests
parent75db7f4902ffd756f06c14e4328ebeda6a527800 (diff)
downloadcryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.tar.gz
cryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.tar.bz2
cryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.zip
Use AlreadyFinalized not ValueError
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_padding.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/hazmat/primitives/test_padding.py b/tests/hazmat/primitives/test_padding.py
index 932cef1e..cac54f27 100644
--- a/tests/hazmat/primitives/test_padding.py
+++ b/tests/hazmat/primitives/test_padding.py
@@ -17,6 +17,7 @@ import pytest
import six
+from cryptography.exceptions import AlreadyFinalized
from cryptography.hazmat.primitives import padding
@@ -97,15 +98,15 @@ class TestPKCS7(object):
def test_use_after_finalize(self):
padder = padding.PKCS7(128).padder()
b = padder.finalize()
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
padder.update(b"")
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
padder.finalize()
unpadder = padding.PKCS7(128).unpadder()
unpadder.update(b)
unpadder.finalize()
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
unpadder.update(b"")
- with pytest.raises(ValueError):
+ with pytest.raises(AlreadyFinalized):
unpadder.finalize()