Skip to content

Commit

Permalink
update cilogon test
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Oct 13, 2017
1 parent 0745fc7 commit e227ee7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions oauthenticator/tests/test_cilogon.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import re
import functools
import json
from io import BytesIO

from pytest import fixture, mark
from urllib.parse import urlparse, parse_qs
from tornado.httpclient import HTTPRequest, HTTPResponse
from tornado.httputil import HTTPHeaders

from ..cilogon import CILogonOAuthenticator

Expand All @@ -16,7 +10,7 @@
def user_model(username):
"""Return a user model"""
return {
'sub': 'http://cilogon.org/dinosaurs/users/%s/1729' % username,
'eppn': username + '@serenity.space',
}


Expand All @@ -38,12 +32,10 @@ def test_cilogon(cilogon_client):
user_info = yield authenticator.authenticate(handler)
print(json.dumps(user_info, sort_keys=True, indent=4))
name = user_info['name']
assert name == 'http://cilogon.org/dinosaurs/users/wash/1729'
assert name == 'wash@serenity.space'
auth_state = user_info['auth_state']
assert 'access_token' in auth_state
assert auth_state == {
'access_token': auth_state['access_token'],
'cilogon_user': {
'sub': name
}
'cilogon_user': user_model('wash'),
}

0 comments on commit e227ee7

Please sign in to comment.