diff options
Diffstat (limited to 'tests/test_bigfile.py')
-rw-r--r-- | tests/test_bigfile.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/test_bigfile.py b/tests/test_bigfile.py index b45b52f..87d76f6 100644 --- a/tests/test_bigfile.py +++ b/tests/test_bigfile.py @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -'''Tests block operations.''' +"""Tests block operations.""" + from rsa._compat import b try: @@ -26,10 +27,9 @@ import unittest import rsa from rsa import bigfile, varblock, pkcs1 -class BigfileTest(unittest.TestCase): +class BigfileTest(unittest.TestCase): def test_encrypt_decrypt_bigfile(self): - # Expected block size + 11 bytes padding pub_key, priv_key = rsa.newkeys((6 + 11) * 8) @@ -48,16 +48,14 @@ class BigfileTest(unittest.TestCase): bigfile.decrypt_bigfile(cryptfile, clearfile, priv_key) self.assertEquals(clearfile.getvalue(), message) - + # We have 2x6 bytes in the message, so that should result in two # bigfile. cryptfile.seek(0) varblocks = list(varblock.yield_varblocks(cryptfile)) self.assertEqual(2, len(varblocks)) - def test_sign_verify_bigfile(self): - # Large enough to store MD5-sum and ASN.1 code for MD5 pub_key, priv_key = rsa.newkeys((34 + 11) * 8) @@ -72,5 +70,4 @@ class BigfileTest(unittest.TestCase): # Alter the message, re-check msgfile = BytesIO(b('123456sybren')) self.assertRaises(pkcs1.VerificationError, - pkcs1.verify, msgfile, signature, pub_key) - + pkcs1.verify, msgfile, signature, pub_key) |