(self, backend)
| 189 | f.decrypt(b"\x00" * 16) |
| 190 | |
| 191 | def test_decrypt_at_time(self, backend): |
| 192 | f1 = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend) |
| 193 | f = MultiFernet([f1]) |
| 194 | pt = b"encrypt me" |
| 195 | token = f.encrypt_at_time(pt, current_time=100) |
| 196 | assert f.decrypt_at_time(token, ttl=1, current_time=100) == pt |
| 197 | with pytest.raises(InvalidToken): |
| 198 | f.decrypt_at_time(token, ttl=1, current_time=102) |
| 199 | with pytest.raises(ValueError): |
| 200 | f.decrypt_at_time( |
| 201 | token, |
| 202 | ttl=None, # type: ignore[arg-type] |
| 203 | current_time=100, |
| 204 | ) |
| 205 | |
| 206 | def test_no_fernets(self, backend): |
| 207 | with pytest.raises(ValueError): |
nothing calls this directly
no test coverage detected