diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-31 10:20:11 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-31 10:20:11 +0000 |
commit | 5b2ded27ab44fda1a73c73cb949b4f69f336d181 (patch) | |
tree | 52f25dc6433ff97e126a06e76e7f881f67fa380e /python | |
parent | 78bf15ec270fc853569a1b8766560105e69f8a73 (diff) | |
download | lasso-5b2ded27ab44fda1a73c73cb949b4f69f336d181.tar.gz lasso-5b2ded27ab44fda1a73c73cb949b4f69f336d181.tar.xz lasso-5b2ded27ab44fda1a73c73cb949b4f69f336d181.zip |
Testing logout.processResponseMsg with a really bad URL. => red alert.
Diffstat (limited to 'python')
-rwxr-xr-x | python/tests/profiles_tests.py | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index e49085bb..a7a665ff 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -132,7 +132,7 @@ class LogoutTestCase(unittest.TestCase): logout = lasso.Logout(lassoServer, lasso.providerTypeIdp) self.failIf(logout.getNextProviderId()) - def test01(self): + def test03(self): """IDP logout; testing processRequestMsg with non Liberty query.""" lassoServer = lasso.Server( @@ -146,7 +146,7 @@ class LogoutTestCase(unittest.TestCase): os.path.join(dataDir, 'sp1-la/public-key.pem'), os.path.join(dataDir, 'sp1-la/certificate.pem')) logout = lasso.Logout(lassoServer, lasso.providerTypeIdp) - # The processRequestMsg should failt but not abort. + # The processRequestMsg should fail but not abort. try: logout.processRequestMsg('passport=0&lasso=1', lasso.httpMethodRedirect) except SyntaxError: @@ -154,6 +154,28 @@ class LogoutTestCase(unittest.TestCase): else: self.fail('Logout processRequestMsg should have failed.') + def test04(self): + """IDP logout; testing processResponseMsg with non Liberty query.""" + + lassoServer = lasso.Server( + os.path.join(dataDir, 'idp1-la/metadata.xml'), + None, # os.path.join(dataDir, 'idp1-la/public-key.pem') is no more used + os.path.join(dataDir, 'idp1-la/private-key-raw.pem'), + os.path.join(dataDir, 'idp1-la/certificate.pem'), + lasso.signatureMethodRsaSha1) + lassoServer.addProvider( + os.path.join(dataDir, 'sp1-la/metadata.xml'), + os.path.join(dataDir, 'sp1-la/public-key.pem'), + os.path.join(dataDir, 'sp1-la/certificate.pem')) + logout = lasso.Logout(lassoServer, lasso.providerTypeIdp) + # The processResponseMsg should fail but not abort. + try: + logout.processResponseMsg('liberty=&alliance', lasso.httpMethodRedirect) + except SyntaxError: + pass + else: + self.fail('Logout processResponseMsg should have failed.') + class DefederationTestCase(unittest.TestCase): def test01(self): @@ -170,7 +192,7 @@ class DefederationTestCase(unittest.TestCase): os.path.join(dataDir, 'sp1-la/public-key.pem'), os.path.join(dataDir, 'sp1-la/certificate.pem')) defederation = lasso.Defederation(lassoServer, lasso.providerTypeIdp) - # The processNotificationMsg should failt but not abort. + # The processNotificationMsg should fail but not abort. try: defederation.processNotificationMsg('nonLibertyQuery=1', lasso.httpMethodRedirect) except SyntaxError: |