blob: 261a21d6cc02cb65e827ca26cfd2cd6154be8efd [file] [log] [blame]
Terry Chiacc2a8282015-03-22 12:06:45 +08001import pytest
2
3from cryptography.fernet import Fernet
4
5hypothesis = pytest.importorskip("hypothesis")
6
7
8@hypothesis.given(bytes)
9def test_fernet(data):
10 f = Fernet(Fernet.generate_key())
11 ct = f.encrypt(data)
12 assert f.decrypt(ct) == data