diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-29 14:26:11 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-10-29 14:26:11 -0700 |
commit | 60ad3e182476d84daeb7cff9d333623a688edd61 (patch) | |
tree | d82f2e1d7c395927d8c3636e07e26951ab5afb2c /tests/hazmat/primitives | |
parent | 25f96e511f1e1bf70393cdd34c83f57a4b45d458 (diff) | |
download | cryptography-60ad3e182476d84daeb7cff9d333623a688edd61.tar.gz cryptography-60ad3e182476d84daeb7cff9d333623a688edd61.tar.bz2 cryptography-60ad3e182476d84daeb7cff9d333623a688edd61.zip |
Clean up var naming
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_padding.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/hazmat/primitives/test_padding.py b/tests/hazmat/primitives/test_padding.py index f689dda0..798b2a77 100644 --- a/tests/hazmat/primitives/test_padding.py +++ b/tests/hazmat/primitives/test_padding.py @@ -29,9 +29,7 @@ class TestPKCS7(object): (128, b""), ]) def test_invalid_padding(self, size, padded): - padder = padding.PKCS7(size) - - unpadder = padder.unpadder() + unpadder = padding.PKCS7(size).unpadder() with pytest.raises(ValueError): unpadder.update(padded) unpadder.finalize() @@ -59,8 +57,7 @@ class TestPKCS7(object): ) ]) def test_pad(self, size, unpadded, padded): - padder = padding.PKCS7(size) - padder = padder.padder() + padder = padding.PKCS7(size).padder() result = padder.update(unpadded) result += padder.finalize() assert result == padded @@ -78,23 +75,20 @@ class TestPKCS7(object): ), ]) def test_unpad(self, size, unpadded, padded): - padder = padding.PKCS7(size) - unpadder = padder.unpadder() + unpadder = padding.PKCS7(size).unpadder() result = unpadder.update(padded) result += unpadder.finalize() assert result == unpadded def test_use_after_finalize(self): - p = padding.PKCS7(128) - - padder = p.padder() + padder = padding.PKCS7(128).padder() b = padder.finalize() with pytest.raises(ValueError): padder.update(b"") with pytest.raises(ValueError): padder.finalize() - unpadder = p.unpadder() + unpadder = padding.PKCS7(128).unpadder() unpadder.update(b) unpadder.finalize() with pytest.raises(ValueError): |