summaryrefslogtreecommitdiffstats
path: root/python/tests/login_tests.py
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-09 18:00:27 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-09 18:00:27 +0000
commiteb450efe8c113e44e002524428d5957d2bc58cf5 (patch)
tree2cd5c3ba9889db3ec3307764f8648eafb8dfdb8f /python/tests/login_tests.py
parente851b95362633806e5ec851ff04d458b732d3ccd (diff)
downloadlasso-eb450efe8c113e44e002524428d5957d2bc58cf5.tar.gz
lasso-eb450efe8c113e44e002524428d5957d2bc58cf5.tar.xz
lasso-eb450efe8c113e44e002524428d5957d2bc58cf5.zip
LECP now nearly works. Still a segmentation fault at the end, but Valos is
aware of it.
Diffstat (limited to 'python/tests/login_tests.py')
-rw-r--r--python/tests/login_tests.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py
index 88034c3c..54827aee 100644
--- a/python/tests/login_tests.py
+++ b/python/tests/login_tests.py
@@ -251,13 +251,23 @@ class LoginTestCase(unittest.TestCase):
idpSite = self.generateIdpSite(internet)
spSite = self.generateSpSite(internet)
spSite.idpSite = idpSite
- lec = self.generateLibertyEnabledClient(internet)
- lec.idpSite = idpSite
principal = Principal(internet, 'Romain Chantereau')
principal.keyring[idpSite.url] = 'Chantereau'
principal.keyring[spSite.url] = 'Romain'
+ lec = self.generateLibertyEnabledClient(internet)
+ lec.idpSite = idpSite
+
+ # Try LECP, but the principal is not authenticated on identity-provider. So, LECP must
+ # fail.
httpResponse = lec.login(principal, spSite, '/login')
- raise str((httpResponse.statusCode, httpResponse.statusMessage, httpResponse.headers['Content-Type'], httpResponse.body))
+ failUnlessEqual(httpResponse.statusCode, 401)
+
+ # Now we authenticate principal, before testing LECP. So, LECP must succeed.
+ httpResponse = principal.sendHttpRequestToSite(spSite, 'GET', '/login')
+ failUnlessEqual(httpResponse.statusCode, 200)
+ idpSite.createSession(lec)
+ httpResponse = lec.login(principal, spSite, '/login')
+ failUnlessEqual(httpResponse.statusCode, 200)
suite1 = unittest.makeSuite(LoginTestCase, 'test')