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

Method test_timestamp_ignored_no_ttl

tests/test_fernet.py:123–128  ·  view source on GitHub ↗
(self, monkeypatch, backend)

Source from the content-addressed store, hash-verified

121 f.decrypt(12345) # type: ignore[arg-type]
122
123 def test_timestamp_ignored_no_ttl(self, monkeypatch, backend):
124 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)
125 pt = b"encrypt me"
126 token = f.encrypt(pt)
127 monkeypatch.setattr(time, "time", pretend.raiser(ValueError))
128 assert f.decrypt(token, ttl=None) == pt
129
130 def test_ttl_required_in_decrypt_at_time(self, backend):
131 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)

Callers

nothing calls this directly

Calls 3

encryptMethod · 0.95
decryptMethod · 0.95
FernetClass · 0.90

Tested by

no test coverage detected