commit | ce8f9a4e2a5d159356a06147f65e221dbdf43171 | [log] [tgz] |
---|---|---|
author | Alex Gaynor <alex.gaynor@gmail.com> | Thu Oct 31 15:23:15 2013 -0700 |
committer | Alex Gaynor <alex.gaynor@gmail.com> | Thu Oct 31 15:23:15 2013 -0700 |
tree | 15576747f0539437673ba44d61c73c2c3f448777 | |
parent | c1ea0a0d23115bb0586230a139bcb2b60adb6262 [diff] [blame] |
A test for roundtripping
diff --git a/tests/test_fernet.py b/tests/test_fernet.py index b0f22f0..a42011a 100644 --- a/tests/test_fernet.py +++ b/tests/test_fernet.py
@@ -61,3 +61,10 @@ f.encrypt(six.u("")) with pytest.raises(TypeError): f.decrypt(six.u("")) + + @pytest.mark.parametrize("message", [b"", b"Abc!", b"\x00\xFF\x00\x80"]) + def test_roundtrips(self, message): + f = Fernet(b"\x00" * 32) + ciphertext = f.encrypt(message) + plaintext = f.decrypt(ciphertext) + assert plaintext == message