From eb450efe8c113e44e002524428d5957d2bc58cf5 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Mon, 9 Aug 2004 18:00:27 +0000 Subject: LECP now nearly works. Still a segmentation fault at the end, but Valos is aware of it. --- python/tests/login_tests.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'python/tests/login_tests.py') 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') -- cgit