From 7645ac70fdbe5d3881a054af0f7ec17953de8c53 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Sun, 28 Dec 2014 16:51:35 +0100 Subject: [PATCH] More error info --- src/oic/oic/__init__.py | 3 ++- tests/test_oic.py | 10 +--------- tests/test_oic_consumer.py | 6 +++--- tests/test_oic_provider.py | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/oic/oic/__init__.py b/src/oic/oic/__init__.py index ac97186..95934a5 100644 --- a/src/oic/oic/__init__.py +++ b/src/oic/oic/__init__.py @@ -791,7 +791,8 @@ class Client(oauth2.Client): raise PyoidcError("ERROR: Something went wrong: %s" % resp.text) else: raise PyoidcError( - "ERROR: Something went wrong [%s]" % resp.status_code) + "ERROR: Something went wrong [%s]: %s" % (resp.status_code, + resp.text)) return schema_class().from_json(txt=resp.text) diff --git a/tests/test_oic.py b/tests/test_oic.py index f3a9efe..b591adf 100644 --- a/tests/test_oic.py +++ b/tests/test_oic.py @@ -1157,17 +1157,9 @@ def test_make_id_token(): assert atr.verify(keyjar=srv.keyjar) -def test_endpoint2issuer(): - from pinit import provider_init - client = Client() - client.provider_info = {"/": provider_init.create_providerinfo()} - issuer = client.endpoint2issuer("/registration") - assert issuer == "/" - - if __name__ == "__main__": # t = TestOICClient() # t.setup_class() # t.test_access_token_request() - test_endpoint2issuer() + test_make_id_token() diff --git a/tests/test_oic_consumer.py b/tests/test_oic_consumer.py index 0b7ec2e..4cf5a5d 100644 --- a/tests/test_oic_consumer.py +++ b/tests/test_oic_consumer.py @@ -481,9 +481,9 @@ def test_sign_userinfo(): consumer.set_client_secret("hemligt") consumer.keyjar = CLIKEYS consumer.client_prefs = {"userinfo_signed_response_alg": "RS256"} - consumer.provider_info = {"http://localhost:8088": { - "userinfo_endpoint": "http://localhost:8088/userinfo" - }} + consumer.provider_info = { + "userinfo_endpoint": "http://localhost:8088/userinfo", + "issuer": "http://localhost:8088/"} del consumer.config["request_method"] args = { diff --git a/tests/test_oic_provider.py b/tests/test_oic_provider.py index 4dcbb89..96d0d7b 100644 --- a/tests/test_oic_provider.py +++ b/tests/test_oic_provider.py @@ -596,7 +596,7 @@ def test_check_session_endpoint(): idt = IdToken().deserialize(info.message, "json") print idt.keys() assert _eq(idt.keys(), ['sub', 'aud', 'iss', 'acr', 'exp', 'iat']) - assert idt["iss"] == server.name + assert idt["iss"] == server.name + "/" def test_registration_endpoint():