diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-20 14:34:35 -0700 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-10-20 14:34:35 -0700 |
commit | 41b33b70d3f9c937d80c264627d1195692a17863 (patch) | |
tree | d34687e2ec1d25abfba0265fce1cb6b6d1db7da5 | |
parent | 4f286cec7a28169ac8939cc01aa6fdead47ac58e (diff) | |
download | cryptography-41b33b70d3f9c937d80c264627d1195692a17863.tar.gz cryptography-41b33b70d3f9c937d80c264627d1195692a17863.tar.bz2 cryptography-41b33b70d3f9c937d80c264627d1195692a17863.zip |
flake8 + cleanup
-rw-r--r-- | tests/test_fernet.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_fernet.py b/tests/test_fernet.py index 58f89cbf..5c630b9e 100644 --- a/tests/test_fernet.py +++ b/tests/test_fernet.py @@ -125,16 +125,15 @@ class TestFernet(object): ) class TestMultiFernet(object): def test_encrypt(self, backend): - single_f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) - f = MultiFernet([ - single_f, - Fernet(base64.urlsafe_b64encode(b"\x01" * 32), backend=backend) - ]) - assert single_f.decrypt(f.encrypt(b"abc")) == b"abc" + f1 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) + f2 = Fernet(base64.urlsafe_b64encode(b"\x01" * 32), backend=backend) + f = MultiFernet([f1, f2]) + + assert f1.decrypt(f.encrypt(b"abc")) == b"abc" def test_decrypt(self, backend): f1 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) - f2 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) + f2 = Fernet(base64.urlsafe_b64encode(b"\x01" * 32), backend=backend) f = MultiFernet([f1, f2]) assert f.decrypt(f1.encrypt(b"abc")) == b"abc" |