diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/primitives/test_padding.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_padding.py b/tests/hazmat/primitives/test_padding.py index 798b2a77..3cefafaf 100644 --- a/tests/hazmat/primitives/test_padding.py +++ b/tests/hazmat/primitives/test_padding.py @@ -13,6 +13,8 @@ import pytest +import six + from cryptography.hazmat.primitives import padding @@ -34,6 +36,14 @@ class TestPKCS7(object): unpadder.update(padded) unpadder.finalize() + def test_non_bytes(self): + padder = padding.PKCS7(128).padder() + with pytest.raises(TypeError): + padder.update(six.u("abc")) + unpadder = padding.PKCS7(128).unpadder() + with pytest.raises(TypeError): + unpadder.update(six.u("abc")) + @pytest.mark.parametrize(("size", "unpadded", "padded"), [ ( 128, |