blob: fd2438033c378c98ecb634a4d80dabfd6f443465 [file] [log] [blame]
Terry Chia36a787f2015-09-30 19:13:14 +08001from hypothesis import given
Terry Chia3d7f8d12015-09-27 21:00:58 +08002from hypothesis.strategies import binary
Terry Chia42ea0d12015-09-27 20:26:09 +08003
Terry Chiacc2a8282015-03-22 12:06:45 +08004from cryptography.fernet import Fernet
5
Terry Chia42ea0d12015-09-27 20:26:09 +08006
Terry Chia36a787f2015-09-30 19:13:14 +08007@given(binary())
Terry Chiacc2a8282015-03-22 12:06:45 +08008def test_fernet(data):
9 f = Fernet(Fernet.generate_key())
10 ct = f.encrypt(data)
11 assert f.decrypt(ct) == data