diff options
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 |