diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-10-02 22:23:57 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-10-02 22:23:57 +0000 |
| commit | eee077c0e2f6e8a05803afb48ad5af4c2d01cde7 (patch) | |
| tree | a1683daf7594cca15daf4c94fb69327d2075964c | |
| parent | fccd418c36034c39aa8d1890e49bc161a3c65777 (diff) | |
| download | lasso-eee077c0e2f6e8a05803afb48ad5af4c2d01cde7.tar.gz lasso-eee077c0e2f6e8a05803afb48ad5af4c2d01cde7.tar.xz lasso-eee077c0e2f6e8a05803afb48ad5af4c2d01cde7.zip | |
Removed SWIG_Warning which doesn't exist in Swig.
Updated Python tests.
| -rwxr-xr-x | python/tests/profiles_tests.py | 15 | ||||
| -rw-r--r-- | swig/Lasso.i | 7 |
2 files changed, 10 insertions, 12 deletions
diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index 9607a7e1..060e94cb 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -143,8 +143,9 @@ class LogoutTestCase(unittest.TestCase): # The processRequestMsg should fail but not abort. try: logout.processRequestMsg('passport=0&lasso=1', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Logout processRequestMsg should have failed.') @@ -164,8 +165,9 @@ class LogoutTestCase(unittest.TestCase): # The processResponseMsg should fail but not abort. try: logout.processResponseMsg('liberty=&alliance', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Logout processResponseMsg should have failed.') @@ -200,8 +202,9 @@ class DefederationTestCase(unittest.TestCase): # The processNotificationMsg should fail but not abort. try: defederation.processNotificationMsg('nonLibertyQuery=1', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Defederation processNotificationMsg should have failed.') diff --git a/swig/Lasso.i b/swig/Lasso.i index 2d8379e8..6a12a2ef 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -560,10 +560,6 @@ void build_exception_msg(int errorCode, char *errorMsg) { sprintf(errorMsg, "%d / Lasso Error", errorCode); } -int get_exception_type(int errorCode) { - return errorCode > 0 ? SWIG_Warning : SWIG_UnknownError; -} - %} %define THROW_ERROR @@ -572,8 +568,7 @@ int get_exception_type(int errorCode) { errorCode = $action if (errorCode) { char errorMsg[256]; - SWIG_exception(get_exception_type(errorCode), - build_exception_msg(errorCode, errorMsg)); + SWIG_exception(SWIG_UnknownError, build_exception_msg(errorCode, errorMsg)); } } %enddef |
