From 4114123182bc38ff38c4aa493fa80b85f841a469 Mon Sep 17 00:00:00 2001 From: roland Date: Mon, 16 Mar 2020 10:15:21 +0100 Subject: [PATCH] fixed test --- tests/test_06_oidc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_06_oidc.py b/tests/test_06_oidc.py index 0f620ce..908482e 100755 --- a/tests/test_06_oidc.py +++ b/tests/test_06_oidc.py @@ -8,6 +8,7 @@ import pytest from cryptojwt.exception import BadSignature +from cryptojwt.exception import UnsupportedAlgorithm from cryptojwt.jws.exception import SignerAlgError from cryptojwt.jws.utils import left_hash from cryptojwt.jwt import JWT @@ -1422,10 +1423,11 @@ def test_wrong_sign_alg(): packer = JWT(kj, sign_alg='HS256', lifetime=3600, iss='https://example.com/op') _jws = packer.pack(payload=idt.to_dict()) msg = AuthorizationResponse(id_token=_jws) - assert verify_id_token(msg, check_hash=True, keyjar=kj, + with pytest.raises(UnsupportedAlgorithm): + verify_id_token(msg, check_hash=True, keyjar=kj, iss="https://example.com/op", client_id="554295ce3770612820620000", - allowed_sign_alg="RS256") is False + allowed_sign_alg="RS256") def test_correct_sign_alg():