aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_with_hypothesis.py
blob: 31dfa04c589af5bb96101a121be86a39fc7fd267 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from hypothesis.strategies import binary

import pytest

from cryptography.fernet import Fernet


hypothesis = pytest.importorskip("hypothesis")


@hypothesis.given(binary())
def test_fernet(data):
    f = Fernet(Fernet.generate_key())
    ct = f.encrypt(data)
    assert f.decrypt(ct) == data