Commit 5538e907 by Ed Crewe

check changes

parent b1ae6a56
...@@ -98,7 +98,7 @@ class TestCAS(unittest.TestCase): ...@@ -98,7 +98,7 @@ class TestCAS(unittest.TestCase):
dom = dom.getElementsByTagName(level)[0] dom = dom.getElementsByTagName(level)[0]
except: except:
break break
return dom.childNodes[0].nodeValue return dom.childNodes[0].nodeValue.strip()
def find_in_page(self, page, starts, stop): def find_in_page(self, page, starts, stop):
""" Replace this with find_in_dom ? """ Replace this with find_in_dom ?
...@@ -109,7 +109,7 @@ class TestCAS(unittest.TestCase): ...@@ -109,7 +109,7 @@ class TestCAS(unittest.TestCase):
start = end + page[end:].find(starts[1]) + len(starts[1]) start = end + page[end:].find(starts[1]) + len(starts[1])
end = start + page[start:].find(stop) end = start + page[start:].find(stop)
found = page[start:end] found = page[start:end]
return found return found.strip()
def login(self): def login(self):
""" Login to CAS server """ """ Login to CAS server """
...@@ -150,6 +150,7 @@ class TestCAS(unittest.TestCase): ...@@ -150,6 +150,7 @@ class TestCAS(unittest.TestCase):
""" Use login ticket to get proxy iou """ """ Use login ticket to get proxy iou """
url_args = (CAS_SERVER_URL, self.ticket, APP_URL, PROXY_URL) url_args = (CAS_SERVER_URL, self.ticket, APP_URL, PROXY_URL)
url = '%s/serviceValidate?ticket=%s&service=%s&pgtUrl=%s' % url_args url = '%s/serviceValidate?ticket=%s&service=%s&pgtUrl=%s' % url_args
return url
try: try:
iou = self.opener.open(url) iou = self.opener.open(url)
except: except:
...@@ -162,13 +163,14 @@ class TestCAS(unittest.TestCase): ...@@ -162,13 +163,14 @@ class TestCAS(unittest.TestCase):
if iou_ticket: if iou_ticket:
return iou_ticket return iou_ticket
else: else:
return 'FAIL: PGIOU Empty response' return 'FAIL: PGIOU Empty response from %s' % url
else: else:
return 'FAIL: PGIOU Response failed authentication' return 'FAIL: PGIOU Response failed authentication'
return None return None
def get_proxy(self, iou): def get_proxy(self, iou):
""" Use login ticket to get proxy """ """ Use login ticket to get proxy """
return
url_args = (PROXY_URL, iou) url_args = (PROXY_URL, iou)
url = '%s/pgtCallback?pgtIou=%s' % url_args url = '%s/pgtCallback?pgtIou=%s' % url_args
try: try:
......
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