diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-09-05 09:13:58 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-09-05 09:13:58 +0000 |
| commit | 34013a6092c2cd22138eb882355a69126b662096 (patch) | |
| tree | 4af75382a6864eb3ad6f59b19e9841100f7a7291 /python | |
| parent | a208f6f6b02fdb553f6f5590cca25b9fd6bc244b (diff) | |
| download | lasso-34013a6092c2cd22138eb882355a69126b662096.tar.gz lasso-34013a6092c2cd22138eb882355a69126b662096.tar.xz lasso-34013a6092c2cd22138eb882355a69126b662096.zip | |
Changed Python exceptions generated by SWIG.
Diffstat (limited to 'python')
| -rw-r--r-- | python/tests/errorchecking_tests.py | 2 | ||||
| -rwxr-xr-x | python/tests/profiles_tests.py | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/python/tests/errorchecking_tests.py b/python/tests/errorchecking_tests.py index 6dac359f..a27ee9ec 100644 --- a/python/tests/errorchecking_tests.py +++ b/python/tests/errorchecking_tests.py @@ -68,7 +68,7 @@ class ErrorCheckingTestCase(unittest.TestCase): login = lasso.Login(server) try: login.initFromAuthnRequestMsg("", lasso.httpMethodRedirect) - except: + except lasso.Error: pass diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index 211920b0..bfbbd79e 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -109,9 +109,8 @@ class LogoutTestCase(unittest.TestCase): logout = lasso.Logout(lassoServer, lasso.providerTypeSp) try: logout.initRequest() - except RuntimeError, error: - errorCode = int(error.args[0].split(' ', 1)[0]) - if errorCode != -1: + except lasso.Error, error: + if error[0] != -1: raise else: self.fail('logout.initRequest without having set identity before should fail') @@ -149,7 +148,7 @@ class LogoutTestCase(unittest.TestCase): # The processRequestMsg should fail but not abort. try: logout.processRequestMsg('passport=0&lasso=1', lasso.httpMethodRedirect) - except SyntaxError: + except lasso.SyntaxError: pass else: self.fail('Logout processRequestMsg should have failed.') @@ -171,7 +170,7 @@ class LogoutTestCase(unittest.TestCase): # The processResponseMsg should fail but not abort. try: logout.processResponseMsg('liberty=&alliance', lasso.httpMethodRedirect) - except SyntaxError: + except lasso.SyntaxError: pass else: self.fail('Logout processResponseMsg should have failed.') @@ -209,7 +208,7 @@ class DefederationTestCase(unittest.TestCase): # The processNotificationMsg should fail but not abort. try: defederation.processNotificationMsg('nonLibertyQuery=1', lasso.httpMethodRedirect) - except SyntaxError: + except lasso.SyntaxError: pass else: self.fail('Defederation processNotificationMsg should have failed.') |
