Commit 37fa9dbe by Ed Crewe

getting success again

parent 8ecadd84
...@@ -98,8 +98,8 @@ class TestCAS(unittest.TestCase): ...@@ -98,8 +98,8 @@ class TestCAS(unittest.TestCase):
print 'PASS: Got PT - %s' % pt print 'PASS: Got PT - %s' % pt
else: else:
print pt print pt
#self.logout()
# self.logout()
print '' print ''
print 'Test SSO server login with proxy ticket' print 'Test SSO server login with proxy ticket'
print '---------------------------------------' print '---------------------------------------'
...@@ -108,12 +108,13 @@ class TestCAS(unittest.TestCase): ...@@ -108,12 +108,13 @@ class TestCAS(unittest.TestCase):
print 'PASS: Got Success response for app %s using proxy %s' % (self.urls['app'], proxy) print 'PASS: Got Success response for app %s using proxy %s' % (self.urls['app'], proxy)
else: else:
print 'FAIL: The proxy login to %s via %s has failed' % (self.urls['app'], self.urls['proxy']) print 'FAIL: The proxy login to %s via %s has failed' % (self.urls['app'], self.urls['proxy'])
self.logout() self.logout()
print '' print ''
print 'Test direct proxy login' print 'Test direct proxy login'
print '-----------------------' print '-----------------------'
self.proxy5_login(pt) self.proxy5_login(pt)
return
def get_auth(self): def get_auth(self):
...@@ -222,9 +223,15 @@ class TestCAS(unittest.TestCase): ...@@ -222,9 +223,15 @@ class TestCAS(unittest.TestCase):
""" """
url = '%s%s' % (self.urls['app'], APP_RESTRICTED) url = '%s%s' % (self.urls['app'], APP_RESTRICTED)
if ticket: if ticket:
url = '%s&ticket=%s' % (url, ticket) url = '%s?ticket=%s' % (url, ticket)
app_resp = self.opener.open(url) print url
ok = app_resp.code == 200 return
try:
app_resp = self.opener.open(url)
ok = app_resp.code == 200
except:
print 'FAIL: couldnt log in to restricted app at %s' % url
return
page = app_resp.read() page = app_resp.read()
if ok: if ok:
token = self.get_token(page=page) token = self.get_token(page=page)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment