commit | cc2a828883d03800b3d7a145571796f01f3ed7d9 | [log] [tgz] |
---|---|---|
author | Terry Chia <terrycwk1994@gmail.com> | Sun Mar 22 12:06:45 2015 +0800 |
committer | Terry Chia <terrycwk1994@gmail.com> | Sat Sep 26 22:31:53 2015 +0800 |
tree | b5d3cfac249591edc8444ae2835db10e8f7955db | |
parent | 7f0705ce3280c31934f111e6b4bba91260cf9cb5 [diff] [blame] |
Add hypothesis test for Fernet.
diff --git a/tests/test_with_hypothesis.py b/tests/test_with_hypothesis.py new file mode 100644 index 0000000..261a21d --- /dev/null +++ b/tests/test_with_hypothesis.py
@@ -0,0 +1,12 @@ +import pytest + +from cryptography.fernet import Fernet + +hypothesis = pytest.importorskip("hypothesis") + + +@hypothesis.given(bytes) +def test_fernet(data): + f = Fernet(Fernet.generate_key()) + ct = f.encrypt(data) + assert f.decrypt(ct) == data