MCPcopy
hub / github.com/pyca/cryptography / test_roundtrips

Method test_roundtrips

tests/test_fernet.py:142–144  ·  view source on GitHub ↗
(self, message, backend)

Source from the content-addressed store, hash-verified

140
141 @pytest.mark.parametrize("message", [b"", b"Abc!", b"\x00\xff\x00\x80"])
142 def test_roundtrips(self, message, backend):
143 f = Fernet(Fernet.generate_key(), backend=backend)
144 assert f.decrypt(f.encrypt(message)) == message
145
146 @pytest.mark.parametrize("key", [base64.urlsafe_b64encode(b"abc"), b"abc"])
147 def test_bad_key(self, backend, key):

Callers

nothing calls this directly

Calls 4

decryptMethod · 0.95
encryptMethod · 0.95
FernetClass · 0.90
generate_keyMethod · 0.80

Tested by

no test coverage detected