diff options
author | Terry Chia <terrycwk1994@gmail.com> | 2015-03-22 12:06:45 +0800 |
---|---|---|
committer | Terry Chia <terrycwk1994@gmail.com> | 2015-09-26 22:31:53 +0800 |
commit | cc2a828883d03800b3d7a145571796f01f3ed7d9 (patch) | |
tree | b5d3cfac249591edc8444ae2835db10e8f7955db /tests | |
parent | 7f0705ce3280c31934f111e6b4bba91260cf9cb5 (diff) | |
download | cryptography-cc2a828883d03800b3d7a145571796f01f3ed7d9.tar.gz cryptography-cc2a828883d03800b3d7a145571796f01f3ed7d9.tar.bz2 cryptography-cc2a828883d03800b3d7a145571796f01f3ed7d9.zip |
Add hypothesis test for Fernet.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_with_hypothesis.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_with_hypothesis.py b/tests/test_with_hypothesis.py new file mode 100644 index 00000000..261a21d6 --- /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 |