From abd2b66ec8dabf1505b80f6dbd4fd8b023064334 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Fri, 6 Aug 2004 14:41:36 +0000 Subject: Added a new test. If Nico & Valos are not quick enough, the light will be red. --- python/tests/login_tests.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'python/tests') diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py index a4f8f2fd..5d9ebc0f 100644 --- a/python/tests/login_tests.py +++ b/python/tests/login_tests.py @@ -91,8 +91,8 @@ class LoginTestCase(unittest.TestCase): ## def tearDown(self): ## pass - def test01_generateServers(self): - """Service provider initiated login using HTTP redirect ans service provider initiated + def test01(self): + """Service provider initiated login using HTTP redirect and service provider initiated logout using SOAP.""" internet = Internet() @@ -102,6 +102,30 @@ class LoginTestCase(unittest.TestCase): principal = Principal(internet, "Romain Chantereau") principal.keyring[idpSite.url] = "Chantereau" principal.keyring[spSite.url] = "Romain" + + httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/loginUsingRedirect")) + self.failUnlessEqual(httpResponse.statusCode, 200) + httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/logoutUsingSoap")) + self.failUnlessEqual(httpResponse.statusCode, 200) + + def test02(self): + """Service provider initiated login using HTTP redirect and service provider initiated + logout using SOAP.""" + + internet = Internet() + idpSite = self.generateIdpSite(internet) + spSite = self.generateSpSite(internet) + spSite.idpSite = idpSite + principal = Principal(internet, "Romain Chantereau") + principal.keyring[idpSite.url] = "Chantereau" + principal.keyring[spSite.url] = "Romain" + + httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/loginUsingRedirect")) + self.failUnlessEqual(httpResponse.statusCode, 200) + httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/logoutUsingSoap")) + self.failUnlessEqual(httpResponse.statusCode, 200) + + # Once again, but now the principal already has a federation between spSite and idpSite. httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/loginUsingRedirect")) self.failUnlessEqual(httpResponse.statusCode, 200) httpResponse = spSite.doHttpRequest(HttpRequest(principal, "GET", "/logoutUsingSoap")) -- cgit