Skip to content

Commit 85c13a7

Browse files
committed
Added test for verify signature with empty algo
1 parent 3df27db commit 85c13a7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_api_jws.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ def test_verify_signature_with_no_secret(self, jws, payload):
270270

271271
assert 'Signature verification' in str(exc.value)
272272

273+
def test_verify_signature_with_algo_none_throws_exception(self, jws, payload):
274+
example_jws = (
275+
b'e30'
276+
b'.eyJhIjo1fQ'
277+
b'.KEh186CjVw_Q8FadjJcaVnE7hO5Z9nHBbU8TgbhHcBY'
278+
)
279+
280+
with pytest.raises(InvalidAlgorithmError) as exc:
281+
jws.decode(example_jws, 'secret')
282+
273283
def test_invalid_crypto_alg(self, jws, payload):
274284
with pytest.raises(NotImplementedError):
275285
jws.encode(payload, 'secret', algorithm='HS1024')

0 commit comments

Comments
 (0)