summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 10:56:39 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 10:56:39 +0000
commit31aa53988b3d28ef575004985bbaf300e9dc7b0c (patch)
tree5b739dc68f2300adbd358ba36079fe9210257e34 /python
parent740fcce66a749a8b1cf4ea86a41b98a5d89734ed (diff)
downloadlasso-31aa53988b3d28ef575004985bbaf300e9dc7b0c.tar.gz
lasso-31aa53988b3d28ef575004985bbaf300e9dc7b0c.tar.xz
lasso-31aa53988b3d28ef575004985bbaf300e9dc7b0c.zip
Removed SWIG Lasso.c file.
Added a Python test for defederation (currently it aborts).
Diffstat (limited to 'python')
-rw-r--r--python/Makefile.am3
-rw-r--r--python/tests/login_tests.py27
2 files changed, 27 insertions, 3 deletions
diff --git a/python/Makefile.am b/python/Makefile.am
index 6c4a5a34..7e2c55ef 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -6,8 +6,7 @@ python_LTLIBRARIES = _lassomod.la
PYTHON_PACKAGE=lassomod
-_lassomod_la_SOURCES = $(PYTHON_PACKAGE)_wrap.c \
- $(top_srcdir)/swig/Lasso.c
+_lassomod_la_SOURCES = $(PYTHON_PACKAGE)_wrap.c
_lassomod_la_CFLAGS = $(LASSO_CFLAGS) \
-DSWIG_COBJECT_TYPES \
diff --git a/python/tests/login_tests.py b/python/tests/login_tests.py
index e43db5a6..4ecb7b25 100644
--- a/python/tests/login_tests.py
+++ b/python/tests/login_tests.py
@@ -86,10 +86,35 @@ class LogoutTestCase(unittest.TestCase):
self.failIf(logout.get_next_providerID())
+class DefederationTestCase(unittest.TestCase):
+ def test01(self):
+ """IDP initiated defederation; testing process_notification_msg 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.add_provider(
+ 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.
+ try:
+ defederation.process_notification_msg('nonLibertyQuery=1', lasso.httpMethodRedirect)
+ except lasso.Error, error:
+ pass
+ else:
+ fail('Defederation process_notification_msg should have failed.')
+
+
suite1 = unittest.makeSuite(LoginTestCase, 'test')
suite2 = unittest.makeSuite(LogoutTestCase, 'test')
+suite3 = unittest.makeSuite(DefederationTestCase, 'test')
-allTests = unittest.TestSuite((suite1, suite2))
+allTests = unittest.TestSuite((suite1, suite2, suite3))
if __name__ == '__main__':
sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful())