MCPcopy Create free account
hub / github.com/authlib/authlib / test_invalid_input

Function test_invalid_input

tests/jose/test_jws.py:10–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8
9
10def test_invalid_input():
11 jws = JsonWebSignature()
12 with pytest.raises(errors.DecodeError):
13 jws.deserialize("a", "k")
14 with pytest.raises(errors.DecodeError):
15 jws.deserialize("a.b.c", "k")
16 with pytest.raises(errors.DecodeError):
17 jws.deserialize("YQ.YQ.YQ", "k") # a
18 with pytest.raises(errors.DecodeError):
19 jws.deserialize("W10.a.YQ", "k") # []
20 with pytest.raises(errors.DecodeError):
21 jws.deserialize("e30.a.YQ", "k") # {}
22 with pytest.raises(errors.DecodeError):
23 jws.deserialize("eyJhbGciOiJzIn0.a.YQ", "k")
24 with pytest.raises(errors.DecodeError):
25 jws.deserialize("eyJhbGciOiJzIn0.YQ.a", "k")
26
27
28def test_invalid_alg():

Callers

nothing calls this directly

Calls 2

deserializeMethod · 0.95
JsonWebSignatureClass · 0.90

Tested by

no test coverage detected