diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-29 23:57:46 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-29 23:57:46 +0000 |
commit | cd567ad391f0c9a96083b930557905d786dadd7e (patch) | |
tree | 722daa36aa4e4eed9ced884f8956dd33f6f7e0ed /python | |
parent | c0d276aa16fe15c739e3979b1e74a7b0f43e7126 (diff) | |
download | lasso-cd567ad391f0c9a96083b930557905d786dadd7e.tar.gz lasso-cd567ad391f0c9a96083b930557905d786dadd7e.tar.xz lasso-cd567ad391f0c9a96083b930557905d786dadd7e.zip |
SWIG high-level binding now uses camelCase.
Updated SWIG binding to support Java high-level classes.
Simplified java/Makefile.am (but now, it needs to be reworked by an
autotools expert).
ColdFusion simple Java test compiles ok.
Diffstat (limited to 'python')
-rw-r--r-- | python/.cvsignore | 2 | ||||
-rw-r--r-- | python/tests/errorchecking_tests.py | 8 | ||||
-rwxr-xr-x | python/tests/profiles_tests.py | 44 |
3 files changed, 28 insertions, 26 deletions
diff --git a/python/.cvsignore b/python/.cvsignore index e577c501..3129eda0 100644 --- a/python/.cvsignore +++ b/python/.cvsignore @@ -1,3 +1,5 @@ +lasso.py +lasso_wrap.c *.pyc .deps .libs diff --git a/python/tests/errorchecking_tests.py b/python/tests/errorchecking_tests.py index 65cdbbe8..6dac359f 100644 --- a/python/tests/errorchecking_tests.py +++ b/python/tests/errorchecking_tests.py @@ -45,20 +45,20 @@ except NameError: class ErrorCheckingTestCase(unittest.TestCase): def test01(self): try: - lasso.Login(None).msg_url + lasso.Login(None).msgUrl except: pass def test02(self): # Same as test01; replace Login by Logout try: - lasso.Logout(None, lasso.providerTypeSp).msg_url + lasso.Logout(None, lasso.providerTypeSp).msgUrl 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 + # initFromAuthnRequestMsg; surely it shouldn't segfault server = lasso.Server( os.path.join(dataDir, 'idp1-la/metadata.xml'), None, # os.path.join(dataDir, 'idp1-la/public-key.pem') is no more used @@ -67,7 +67,7 @@ class ErrorCheckingTestCase(unittest.TestCase): lasso.signatureMethodRsaSha1) login = lasso.Login(server) try: - login.init_from_authn_request_msg("", lasso.httpMethodRedirect) + login.initFromAuthnRequestMsg("", lasso.httpMethodRedirect) except: pass diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index 0fced9e6..2939ac4d 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -44,7 +44,7 @@ except NameError: class ServerTestCase(unittest.TestCase): def test01(self): - """Server construction, dump & new_from_dump.""" + """Server construction, dump & newFromDump.""" lassoServer = lasso.Server( os.path.join(dataDir, 'sp1-la/metadata.xml'), @@ -52,22 +52,22 @@ class ServerTestCase(unittest.TestCase): os.path.join(dataDir, 'sp1-la/private-key-raw.pem'), os.path.join(dataDir, 'sp1-la/certificate.pem'), lasso.signatureMethodRsaSha1) - lassoServer.add_provider( + lassoServer.addProvider( os.path.join(dataDir, 'idp1-la/metadata.xml'), os.path.join(dataDir, 'idp1-la/public-key.pem'), os.path.join(dataDir, 'idp1-la/certificate.pem')) dump = lassoServer.dump() - lassoServer2 = lassoServer.new_from_dump(dump) + lassoServer2 = lassoServer.newFromDump(dump) dump2 = lassoServer2.dump() self.failUnlessEqual(dump, dump2) def test02(self): - """Server construction without argument, dump & new_from_dump.""" + """Server construction without argument, dump & newFromDump.""" lassoServer = lasso.Server() - lassoServer.add_provider(os.path.join(dataDir, 'idp1-la/metadata.xml')) + lassoServer.addProvider(os.path.join(dataDir, 'idp1-la/metadata.xml')) dump = lassoServer.dump() - lassoServer2 = lassoServer.new_from_dump(dump) + lassoServer2 = lassoServer.newFromDump(dump) dump2 = lassoServer2.dump() self.failUnlessEqual(dump, dump2) @@ -82,19 +82,19 @@ class LoginTestCase(unittest.TestCase): os.path.join(dataDir, 'sp1-la/private-key-raw.pem'), os.path.join(dataDir, 'sp1-la/certificate.pem'), lasso.signatureMethodRsaSha1) - lassoServer.add_provider( + lassoServer.addProvider( os.path.join(dataDir, 'idp1-la/metadata.xml'), os.path.join(dataDir, 'idp1-la/public-key.pem'), os.path.join(dataDir, 'idp1-la/certificate.pem')) login = lasso.Login(lassoServer) - login.init_authn_request(lasso.httpMethodRedirect) - login.authn_request - login.authn_request.protocolProfile = lasso.libProtocolProfileBrwsArt + login.initAuthnRequest(lasso.httpMethodRedirect) + login.authnRequest + login.authnRequest.protocolProfile = lasso.libProtocolProfileBrwsArt class LogoutTestCase(unittest.TestCase): def test01(self): - """SP logout without session and identity; testing init_request.""" + """SP logout without session and identity; testing initRequest.""" lassoServer = lasso.Server( os.path.join(dataDir, 'sp1-la/metadata.xml'), @@ -102,22 +102,22 @@ class LogoutTestCase(unittest.TestCase): os.path.join(dataDir, 'sp1-la/private-key-raw.pem'), os.path.join(dataDir, 'sp1-la/certificate.pem'), lasso.signatureMethodRsaSha1) - lassoServer.add_provider( + lassoServer.addProvider( os.path.join(dataDir, 'idp1-la/metadata.xml'), os.path.join(dataDir, 'idp1-la/public-key.pem'), os.path.join(dataDir, 'idp1-la/certificate.pem')) logout = lasso.Logout(lassoServer, lasso.providerTypeSp) try: - logout.init_request() + logout.initRequest() except RuntimeError, error: errorCode = int(error.args[0].split(' ', 1)[0]) if errorCode != -1: raise else: - self.fail('logout.init_request without having set identity before should fail') + self.fail('logout.initRequest without having set identity before should fail') def test02(self): - """IDP logout without session and identity; testing logout.get_next_providerID.""" + """IDP logout without session and identity; testing logout.getNextProviderId.""" lassoServer = lasso.Server( os.path.join(dataDir, 'idp1-la/metadata.xml'), @@ -125,17 +125,17 @@ class LogoutTestCase(unittest.TestCase): os.path.join(dataDir, 'idp1-la/private-key-raw.pem'), os.path.join(dataDir, 'idp1-la/certificate.pem'), lasso.signatureMethodRsaSha1) - lassoServer.add_provider( + 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) - self.failIf(logout.get_next_providerID()) + self.failIf(logout.getNextProviderId()) class DefederationTestCase(unittest.TestCase): def test01(self): - """IDP initiated defederation; testing process_notification_msg with non Liberty query.""" + """IDP initiated defederation; testing processNotificationMsg with non Liberty query.""" lassoServer = lasso.Server( os.path.join(dataDir, 'idp1-la/metadata.xml'), @@ -143,18 +143,18 @@ class DefederationTestCase(unittest.TestCase): os.path.join(dataDir, 'idp1-la/private-key-raw.pem'), os.path.join(dataDir, 'idp1-la/certificate.pem'), lasso.signatureMethodRsaSha1) - lassoServer.add_provider( + 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')) defederation = lasso.Defederation(lassoServer, lasso.providerTypeIdp) - # The process_notification_msg should failt but not abort. + # The processNotificationMsg should failt but not abort. try: - defederation.process_notification_msg('nonLibertyQuery=1', lasso.httpMethodRedirect) + defederation.processNotificationMsg('nonLibertyQuery=1', lasso.httpMethodRedirect) except SyntaxError: pass else: - self.fail('Defederation process_notification_msg should have failed.') + self.fail('Defederation processNotificationMsg should have failed.') suite1 = unittest.makeSuite(ServerTestCase, 'test') |