More error info

This commit is contained in:
Roland Hedberg 2014-12-28 16:51:35 +01:00
parent a40240a7f5
commit 7645ac70fd
4 changed files with 7 additions and 14 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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 = {

View File

@ -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():