summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-06 14:41:36 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-06 14:41:36 +0000
commitabd2b66ec8dabf1505b80f6dbd4fd8b023064334 (patch)
tree8665ed8b21e5eb6b14313288088bd4c689cd351f /python
parent3473ac144fc4b06c299e803bc7319e3f36b7eb7b (diff)
downloadlasso-abd2b66ec8dabf1505b80f6dbd4fd8b023064334.tar.gz
lasso-abd2b66ec8dabf1505b80f6dbd4fd8b023064334.tar.xz
lasso-abd2b66ec8dabf1505b80f6dbd4fd8b023064334.zip
Added a new test. If Nico & Valos are not quick enough, the light will be red.
Diffstat (limited to 'python')
-rw-r--r--python/tests/login_tests.py28
1 files changed, 26 insertions, 2 deletions
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"))