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

Method test_invalid_start_byte

tests/test_fernet.py:99–102  ·  view source on GitHub ↗
(self, backend)

Source from the content-addressed store, hash-verified

97 f.decrypt(token.encode("ascii"), ttl=ttl_sec)
98
99 def test_invalid_start_byte(self, backend):
100 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)
101 with pytest.raises(InvalidToken):
102 f.decrypt(base64.urlsafe_b64encode(b"\x81"))
103
104 def test_timestamp_too_short(self, backend):
105 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)

Callers

nothing calls this directly

Calls 2

decryptMethod · 0.95
FernetClass · 0.90

Tested by

no test coverage detected