diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-26 09:00:11 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-26 09:00:11 -0500 |
commit | b30402c6b5ad6aa3625fcfbd9e7cb7998670d2f4 (patch) | |
tree | 4edb3415ec207040348d3436f34e40073cd18a28 /tests/hazmat/primitives | |
parent | e6e1b417fd09d0b1f4ff6e54019fe7bebc0ec25c (diff) | |
parent | 425fc045205c1e38ace3c79e501805d63aa2465c (diff) | |
download | cryptography-b30402c6b5ad6aa3625fcfbd9e7cb7998670d2f4.tar.gz cryptography-b30402c6b5ad6aa3625fcfbd9e7cb7998670d2f4.tar.bz2 cryptography-b30402c6b5ad6aa3625fcfbd9e7cb7998670d2f4.zip |
Merge pull request #972 from public/padding-docs
Use AlreadyFinalized instead of 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() |