Fixed test errors.
This commit is contained in:
parent
0ebd155d55
commit
2b70a2a9f8
|
@ -286,12 +286,17 @@ class TestOICConsumer():
|
||||||
assert "code" in atr
|
assert "code" in atr
|
||||||
|
|
||||||
def test_parse_authz_implicit(self):
|
def test_parse_authz_implicit(self):
|
||||||
self.consumer.config["response_type"] = "implicit"
|
mfos = MyFakeOICServer("http://localhost:8088")
|
||||||
|
mfos.keyjar = SRVKEYS
|
||||||
|
|
||||||
|
self.consumer.http_request = mfos.http_request
|
||||||
|
self.consumer.config["response_type"] = "id_token"
|
||||||
_state = "statxxx"
|
_state = "statxxx"
|
||||||
args = {
|
args = {
|
||||||
"client_id": self.consumer.client_id,
|
"client_id": self.consumer.client_id,
|
||||||
"response_type": "implicit",
|
"response_type": "implicit",
|
||||||
"scope": ["openid"],
|
"scope": ["openid"],
|
||||||
|
"redirect_uri": "http://localhost:8088/cb"
|
||||||
}
|
}
|
||||||
|
|
||||||
result = self.consumer.do_authorization_request(
|
result = self.consumer.do_authorization_request(
|
||||||
|
@ -682,22 +687,16 @@ def test_faulty_idtoken_from_accesstoken_endpoint():
|
||||||
#assert result.location.startswith(consumer.redirect_uri[0])
|
#assert result.location.startswith(consumer.redirect_uri[0])
|
||||||
_, query = result.headers["location"].split("?")
|
_, query = result.headers["location"].split("?")
|
||||||
print query
|
print query
|
||||||
part = consumer.parse_authz(query=query)
|
try:
|
||||||
print part
|
consumer.parse_authz(query=query)
|
||||||
auth = part[0]
|
except BadSignature:
|
||||||
acc = part[1]
|
pass
|
||||||
assert part[2] is None
|
else:
|
||||||
|
assert False
|
||||||
#print auth.dictionary()
|
|
||||||
#print acc.dictionary()
|
|
||||||
assert auth is None
|
|
||||||
assert acc.type() == "AccessTokenResponse"
|
|
||||||
assert _eq(acc.keys(), ['access_token', 'id_token', 'expires_in',
|
|
||||||
'token_type', 'state', 'scope'])
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# t = TestOICConsumer()
|
t = TestOICConsumer()
|
||||||
# t.setup_class()
|
t.setup_class()
|
||||||
# t.test_complete()
|
t.test_parse_authz_implicit()
|
||||||
test_faulty_idtoken_from_accesstoken_endpoint()
|
# test_faulty_idtoken_from_accesstoken_endpoint()
|
||||||
|
|
Reference in New Issue