mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
A test for roundtripping
This commit is contained in:
parent
c1ea0a0d23
commit
ce8f9a4e2a
1 changed files with 7 additions and 0 deletions
|
|
@ -61,3 +61,10 @@ class TestFernet(object):
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue