diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-04-25 22:31:44 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-04-25 22:31:44 +0100 |
commit | 575a7f5f93828c1dd133b420490be2183d71fe9c (patch) | |
tree | 23f0fdfc53b4d5edf2dccd0188276ddac1533046 /tests/hazmat/primitives | |
parent | 75db7f4902ffd756f06c14e4328ebeda6a527800 (diff) | |
download | cryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.tar.gz cryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.tar.bz2 cryptography-575a7f5f93828c1dd133b420490be2183d71fe9c.zip |
Use AlreadyFinalized not ValueError
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_padding.py | 9 |
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() |