Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
python
/
cryptography
/
cc2a828883d03800b3d7a145571796f01f3ed7d9
/
.
/
tests
/
test_with_hypothesis.py
blob: 261a21d6cc02cb65e827ca26cfd2cd6154be8efd [
file
] [
log
] [
blame
]
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