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

Method test_non_base64_token

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

Source from the content-addressed store, hash-verified

107 f.decrypt(base64.urlsafe_b64encode(b"\x80abc"))
108
109 def test_non_base64_token(self, backend):
110 f = Fernet(base64.urlsafe_b64encode(b"\x00" * 32), backend=backend)
111 with pytest.raises(InvalidToken):
112 f.decrypt(b"\x00")
113 with pytest.raises(InvalidToken):
114 f.decrypt("nonsensetoken")
115
116 def test_invalid_types(self, backend):
117 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