MCPcopy
hub / github.com/jpadilla/pyjwt / test_encode_decode

Method test_encode_decode

tests/test_api_jws.py:104–109  ·  view source on GitHub ↗
(self, jws: PyJWS, payload: bytes)

Source from the content-addressed store, hash-verified

102 pytest.raises((TypeError, ValueError), PyJWS, options=("something"))
103
104 def test_encode_decode(self, jws: PyJWS, payload: bytes) -> None:
105 secret = "secret"
106 jws_message = jws.encode(payload, secret, algorithm="HS256")
107 decoded_payload = jws.decode(jws_message, secret, algorithms=["HS256"])
108
109 assert decoded_payload == payload
110
111 def test_decode_fails_when_alg_is_not_on_method_algorithms_param(
112 self, jws: PyJWS, payload: bytes

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected