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

Method test_encode_default_algorithm

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

Source from the content-addressed store, hash-verified

181 assert str(exception) == "Invalid header string: must be a json object"
182
183 def test_encode_default_algorithm(self, jws: PyJWS, payload: bytes) -> None:
184 msg = jws.encode(payload, "secret")
185 decoded = jws.decode_complete(msg, "secret", algorithms=["HS256"])
186 assert decoded == {
187 "header": {"alg": "HS256", "typ": "JWT"},
188 "payload": payload,
189 "signature": (
190 b"H\x8a\xf4\xdf3:\xe1\xac\x16E\xd3\xeb\x00\xcf\xfa\xd5\x05\xac"
191 b"e\xc8@\xb6\x00\xd5\xde\x9aa|s\xcfZB"
192 ),
193 }
194
195 def test_encode_algorithm_param_should_be_case_sensitive(
196 self, jws: PyJWS, payload: bytes

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.45
decode_completeMethod · 0.45

Tested by

no test coverage detected