diff options
author | Frederic Peters <fpeters@entrouvert.com> | 2004-08-09 16:08:29 +0000 |
---|---|---|
committer | Frederic Peters <fpeters@entrouvert.com> | 2004-08-09 16:08:29 +0000 |
commit | 8bf3a9d0761edf9fc1b796daf1ee03070bdd38ba (patch) | |
tree | 63aca71dfdfcbb940229d0437f17d644c166f868 /python/tests/errorchecking_tests.py | |
parent | 52694f79f68d6d37794f61c05ec57562bea72bf9 (diff) | |
download | lasso-8bf3a9d0761edf9fc1b796daf1ee03070bdd38ba.tar.gz lasso-8bf3a9d0761edf9fc1b796daf1ee03070bdd38ba.tar.xz lasso-8bf3a9d0761edf9fc1b796daf1ee03070bdd38ba.zip |
new lack of error checking test case; not even the developer fault this time;
the program got bad data; lasso segfault.
Diffstat (limited to 'python/tests/errorchecking_tests.py')
-rw-r--r-- | python/tests/errorchecking_tests.py | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/python/tests/errorchecking_tests.py b/python/tests/errorchecking_tests.py index 87d689e6..717cf4c6 100644 --- a/python/tests/errorchecking_tests.py +++ b/python/tests/errorchecking_tests.py @@ -37,10 +37,35 @@ import lasso class ErrorCheckingTestCase(unittest.TestCase): def test01(self): - lasso.Login(None).msg_url + # the user should call lasso.Login.new(); but what if it doesn't ? + # An exception should be raised; the program should not segfault. + try: + lasso.Login(None).msg_url + except: + pass def test02(self): - lasso.Logout(None, lasso.providerTypeSp).msg_url + # Same as test01; replace Login by Logout + try: + lasso.Logout(None, lasso.providerTypeSp).msg_url + except: + pass + + def test03(self): + # This time; we got something wrong as query string; we pass it to + # init_from_authn_request_msg; surely it shouldn't segfault + server = lasso.Server.new( + '../../examples/data/idp-metadata.xml', + '../../examples/data/idp-public-key.pem', + '../../examples/data/idp-private-key.pem', + '../../examples/data/idp-crt.pem', + lasso.signatureMethodRsaSha1) + login = lasso.Login.new(server) + try: + login.init_from_authn_request_msg("", lasso.httpMethodRedirect) + except: + pass + suite1 = unittest.makeSuite(ErrorCheckingTestCase, 'test') |