diff options
author | Emmanuel Raviart <eraviart@entrouvert.com> | 2005-01-15 13:11:25 +0000 |
---|---|---|
committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2005-01-15 13:11:25 +0000 |
commit | e8de39bae08b511e9b62e71a7d52cce2df10d54f (patch) | |
tree | 3f25381d896eb82440fc2315ba9acc7fe0fe5272 | |
parent | bb27a8d5984ddcf12f0a42e5d8f089759e8749ab (diff) | |
download | lasso-e8de39bae08b511e9b62e71a7d52cce2df10d54f.tar.gz lasso-e8de39bae08b511e9b62e71a7d52cce2df10d54f.tar.xz lasso-e8de39bae08b511e9b62e71a7d52cce2df10d54f.zip |
Updated authors.
Changed authors & copyright in SWIG and unit tests headers.
Extracted binding_tests.py from profiles_tests.py, so that each language has
a binding specific test.
-rw-r--r-- | AUTHORS | 48 | ||||
-rw-r--r-- | java/tests/LoginTest.java | 16 | ||||
-rwxr-xr-x | perl/tests/binding_tests.pl | 25 | ||||
-rwxr-xr-x | php/patch_swig_output.py | 29 | ||||
-rwxr-xr-x | php/tests/binding_tests.php | 27 | ||||
-rwxr-xr-x | php/tests/perfs.php | 27 | ||||
-rw-r--r-- | python/tests/XmlTestRunner.py | 2 | ||||
-rwxr-xr-x | python/tests/binding_tests.py | 249 | ||||
-rw-r--r-- | python/tests/errorchecking_tests.py | 11 | ||||
-rwxr-xr-x | python/tests/profiles_tests.py | 220 | ||||
-rwxr-xr-x | python/tests/tests.py | 12 | ||||
-rw-r--r-- | swig/Lasso-wsf.i | 6 | ||||
-rw-r--r-- | swig/Lasso.i | 6 |
13 files changed, 407 insertions, 271 deletions
@@ -9,51 +9,41 @@ Authors (see README_ for details) -Main Developers -=============== - -- Nicolas Clapiès (initial developer) <nclapies@entrouvert.com> -- Valéry Febvre (lead developer) <vfebvre@easter-eggs.com> - - -Packaging -========= +Core +==== - Nicolas Clapiès <nclapies@entrouvert.com> - Valéry Febvre <vfebvre@easter-eggs.com> - Frédéric Péters <fpeters@entrouvert.com> -C Unit Tests -============ - -- Frédéric Péters <fpeters@entrouvert.com> - - -Java Bindings +SWIG Bindings ============= -- Benjamin Poussin (initial developer) <poussin@codelutin.com> - Emmanuel Raviart <eraviart@entrouvert.com> +with help from: -Java Unit Tests -=============== +- Romain Chantereau <rchantereau@entrouvert.com> (initial SWIG binding) +- Christophe Nowicki <cnowicki@easter-eggs.com> (PHP) +- Benjamin Poussin <poussin@codelutin.com> (first Java binding) +- and the core developers -- Emmanuel Raviart <eraviart@entrouvert.com> +Unit Tests +========== -Python Bindings -=============== +- Emmanuel Raviart <eraviart@entrouvert.com> -- Nicolas Clapiès <nclapies@entrouvert.com> -- Valéry Febvre <vfebvre@easter-eggs.com> +with help from: +- Frédéric Péters <fpeters@entrouvert.com> -Python Unit Tests -================= -- Emmanuel Raviart <eraviart@entrouvert.com> +Packaging +========= + +- Frédéric Péters <fpeters@entrouvert.com> Debian Packaging @@ -89,4 +79,8 @@ Lasso Logo Web Site Design =============== +- Frédéric Péters <fpeters@entrouvert.com> + +with help from: + - Cédric Musso (initial design) <cedric.musso@labor-liber.net> diff --git a/java/tests/LoginTest.java b/java/tests/LoginTest.java index 29ca5bb9..9ff66239 100644 --- a/java/tests/LoginTest.java +++ b/java/tests/LoginTest.java @@ -1,22 +1,23 @@ /* - * JLasso -- Java bindings for Lasso library + * $Id$ * - * Copyright (C) 2004 Entr'ouvert + * Java unit tests for Lasso library + * + * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Benjamin Poussin <poussin@codelutin.com> - * Emmanuel Raviart <eraviart@entrouvert.com> + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -31,8 +32,9 @@ // $ gcj -C -classpath /usr/share/java/junit.jar:../target/lasso.jar:. LoginTest.java // $ gij -classpath /usr/share/java/junit.jar:../target/lasso.jar:. LoginTest -import junit.framework.TestCase; + import junit.framework.Test; +import junit.framework.TestCase; import junit.framework.TestSuite; import com.entrouvert.lasso.*; diff --git a/perl/tests/binding_tests.pl b/perl/tests/binding_tests.pl index b519abee..c8766ed2 100755 --- a/perl/tests/binding_tests.pl +++ b/perl/tests/binding_tests.pl @@ -1,4 +1,27 @@ -#!/usr/bin/env perl +#! /usr/bin/env perl +# +# $Id$ +# +# Perl unit tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use lasso; diff --git a/php/patch_swig_output.py b/php/patch_swig_output.py index 8b46bc42..cd43e013 100755 --- a/php/patch_swig_output.py +++ b/php/patch_swig_output.py @@ -1,8 +1,33 @@ #! /usr/bin/env python +# -*- coding: UTF-8 -*- +# +# $Id$ +# +# SWIG based PHP binding for Lasso Library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -"""Correct Swig output for PHP binding. -The PHP binding of Swig version 1.3.22 has several bugs: +"""Correct SWIG output for PHP binding. + +The PHP binding of SWIG version 1.3.22 has several bugs: (1) It wraps NULL pointers into non NULL PHP objects. diff --git a/php/tests/binding_tests.php b/php/tests/binding_tests.php index b43aef76..bf8ec5fe 100755 --- a/php/tests/binding_tests.php +++ b/php/tests/binding_tests.php @@ -1,4 +1,29 @@ -#! /usr/bin/php +#! /usr/bin/env php +# +# $Id$ +# +# PHP unit tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + <?php $ret = @dl('lasso.' . PHP_SHLIB_SUFFIX); diff --git a/php/tests/perfs.php b/php/tests/perfs.php index 61675135..8dfc41fb 100755 --- a/php/tests/perfs.php +++ b/php/tests/perfs.php @@ -1,4 +1,29 @@ -#! /usr/bin/php +#! /usr/bin/env php +# +# $Id$ +# +# PHP performance tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + <?php $ret = @dl('lasso.' . PHP_SHLIB_SUFFIX); diff --git a/python/tests/XmlTestRunner.py b/python/tests/XmlTestRunner.py index 1d87bc98..c659c259 100644 --- a/python/tests/XmlTestRunner.py +++ b/python/tests/XmlTestRunner.py @@ -1,5 +1,7 @@ # -*- coding: UTF-8 -*- # +# $Id$ +# # XmlTestRunner # # Copyright (C) 2004 Entr'ouvert diff --git a/python/tests/binding_tests.py b/python/tests/binding_tests.py new file mode 100755 index 00000000..0889133e --- /dev/null +++ b/python/tests/binding_tests.py @@ -0,0 +1,249 @@ +#! /usr/bin/env python +# -*- coding: UTF-8 -*- +# +# $Id$ +# +# Python unit tests for Lasso library +# +# Copyright (C) 2004, 2005 Entr'ouvert +# http://lasso.entrouvert.org +# +# Authors: See AUTHORS file. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +import unittest +import sys + +if not '..' in sys.path: + sys.path.insert(0, '..') +if not '../.libs' in sys.path: + sys.path.insert(0, '../.libs') + +import lasso + + +class BindingTestCase(unittest.TestCase): + def test01(self): + """Create and delete nodes.""" + + authnRequest = lasso.LibAuthnRequest() + del authnRequest + + def test02(self): + """Get & set simple attributes of nodes.""" + + authnRequest = lasso.LibAuthnRequest() + + # Test a string attribute. + self.failUnlessEqual(authnRequest.consent, None) + authnRequest.consent = lasso.libConsentObtained + self.failUnlessEqual(authnRequest.consent, lasso.libConsentObtained) + authnRequest.consent = None + self.failUnlessEqual(authnRequest.consent, None) + + # Test a renamed string attribute. + self.failUnlessEqual(authnRequest.relayState, None) + authnRequest.relayState = 'Hello World!' + self.failUnlessEqual(authnRequest.relayState, 'Hello World!') + authnRequest.relayState = None + self.failUnlessEqual(authnRequest.relayState, None) + + # Test an integer attribute. + self.failUnlessEqual(authnRequest.majorVersion, 0) + authnRequest.majorVersion = 314 + self.failUnlessEqual(authnRequest.majorVersion, 314) + + del authnRequest + + def test03(self): + """Get & set attributes of nodes of type string list.""" + + authnRequest = lasso.LibAuthnRequest() + + self.failUnlessEqual(authnRequest.respondWith, None) + + respondWith = lasso.StringList() + self.failUnlessEqual(len(respondWith), 0) + respondWith.append('first string') + self.failUnlessEqual(len(respondWith), 1) + self.failUnlessEqual(respondWith[0], 'first string') + self.failUnlessEqual(respondWith[0], 'first string') + respondWith.append('second string') + self.failUnlessEqual(len(respondWith), 2) + self.failUnlessEqual(respondWith[0], 'first string') + self.failUnlessEqual(respondWith[1], 'second string') + respondWith.append('third string') + self.failUnlessEqual(len(respondWith), 3) + self.failUnlessEqual(respondWith[0], 'first string') + self.failUnlessEqual(respondWith[1], 'second string') + self.failUnlessEqual(respondWith[2], 'third string') + authnRequest.respondWith = respondWith + self.failUnlessEqual(authnRequest.respondWith[0], 'first string') + self.failUnlessEqual(authnRequest.respondWith[1], 'second string') + self.failUnlessEqual(authnRequest.respondWith[2], 'third string') + self.failUnlessEqual(respondWith[0], 'first string') + self.failUnlessEqual(respondWith[1], 'second string') + self.failUnlessEqual(respondWith[2], 'third string') + del respondWith + self.failUnlessEqual(authnRequest.respondWith[0], 'first string') + self.failUnlessEqual(authnRequest.respondWith[1], 'second string') + self.failUnlessEqual(authnRequest.respondWith[2], 'third string') + respondWith = authnRequest.respondWith + self.failUnlessEqual(respondWith[0], 'first string') + self.failUnlessEqual(respondWith[1], 'second string') + self.failUnlessEqual(respondWith[2], 'third string') + del respondWith + self.failUnlessEqual(authnRequest.respondWith[0], 'first string') + self.failUnlessEqual(authnRequest.respondWith[1], 'second string') + self.failUnlessEqual(authnRequest.respondWith[2], 'third string') + authnRequest.respondWith = None + self.failUnlessEqual(authnRequest.respondWith, None) + + del authnRequest + + def test04(self): + """Get & set attributes of nodes of type node list.""" + + response = lasso.SamlpResponse() + + self.failUnlessEqual(response.assertion, None) + + assertions = lasso.NodeList() + self.failUnlessEqual(len(assertions), 0) + assertion1 = lasso.SamlAssertion() + assertion1.assertionId = 'assertion 1' + assertions.append(assertion1) + self.failUnlessEqual(len(assertions), 1) + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + assertion2 = lasso.SamlAssertion() + assertion2.assertionId = 'assertion 2' + assertions.append(assertion2) + self.failUnlessEqual(len(assertions), 2) + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') + assertion3 = lasso.SamlAssertion() + assertion3.assertionId = 'assertion 3' + assertions.append(assertion3) + self.failUnlessEqual(len(assertions), 3) + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') + self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') + response.assertion = assertions + self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') + self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') + self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') + self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') + del assertions + self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') + self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') + self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') + assertions = response.assertion + self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') + self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') + self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') + del assertions + self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') + self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') + self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') + response.assertion = None + self.failUnlessEqual(response.assertion, None) + + del response + + def test05(self): + """Get & set attributes of nodes of type XML list.""" + + authnRequest = lasso.LibAuthnRequest() + + self.failUnlessEqual(authnRequest.extension, None) + + actionString1 = """\ +<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> + <action>do 1</action> +</lib:Extension>""" + actionString2 = """\ +<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> + <action>do 2</action> +</lib:Extension>""" + actionString3 = """\ +<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> + <action>do 3</action> +</lib:Extension>""" + extension = lasso.StringList() + self.failUnlessEqual(len(extension), 0) + extension.append(actionString1) + self.failUnlessEqual(len(extension), 1) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[0], actionString1) + extension.append(actionString2) + self.failUnlessEqual(len(extension), 2) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + extension.append(actionString3) + self.failUnlessEqual(len(extension), 3) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + authnRequest.extension = extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + del extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + extension = authnRequest.extension + self.failUnlessEqual(extension[0], actionString1) + self.failUnlessEqual(extension[1], actionString2) + self.failUnlessEqual(extension[2], actionString3) + del extension + self.failUnlessEqual(authnRequest.extension[0], actionString1) + self.failUnlessEqual(authnRequest.extension[1], actionString2) + self.failUnlessEqual(authnRequest.extension[2], actionString3) + authnRequest.extension = None + self.failUnlessEqual(authnRequest.extension, None) + + del authnRequest + + def test06(self): + """Get & set attributes of nodes of type node.""" + + login = lasso.Login(lasso.Server()) + + self.failUnlessEqual(login.request, None) + login.request = lasso.LibAuthnRequest() + login.request.consent = lasso.libConsentObtained + self.failUnlessEqual(login.request.consent, lasso.libConsentObtained) + login.request = None + self.failUnlessEqual(login.request, None) + + del login + + +bindingSuite = unittest.makeSuite(BindingTestCase, 'test') + +allTests = unittest.TestSuite((bindingSuite, )) + +if __name__ == '__main__': + sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) + diff --git a/python/tests/errorchecking_tests.py b/python/tests/errorchecking_tests.py index 1ea9e1e7..e04ddfff 100644 --- a/python/tests/errorchecking_tests.py +++ b/python/tests/errorchecking_tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters <fpeters@entrouvert.com> -# Emmanuel Raviart <eraviart@entrouvert.com> # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index bc9a4d26..cd7293ba 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters <fpeters@entrouvert.com> -# Emmanuel Raviart <eraviart@entrouvert.com> # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -42,210 +43,6 @@ except NameError: dataDir = '../../tests/data' -class BindingTestCase(unittest.TestCase): - def test01(self): - """Create and delete nodes.""" - - authnRequest = lasso.LibAuthnRequest() - del authnRequest - - def test02(self): - """Get & set simple attributes of nodes.""" - - authnRequest = lasso.LibAuthnRequest() - - # Test a string attribute. - self.failUnlessEqual(authnRequest.consent, None) - authnRequest.consent = lasso.libConsentObtained - self.failUnlessEqual(authnRequest.consent, lasso.libConsentObtained) - authnRequest.consent = None - self.failUnlessEqual(authnRequest.consent, None) - - # Test a renamed string attribute. - self.failUnlessEqual(authnRequest.relayState, None) - authnRequest.relayState = 'Hello World!' - self.failUnlessEqual(authnRequest.relayState, 'Hello World!') - authnRequest.relayState = None - self.failUnlessEqual(authnRequest.relayState, None) - - # Test an integer attribute. - self.failUnlessEqual(authnRequest.majorVersion, 0) - authnRequest.majorVersion = 314 - self.failUnlessEqual(authnRequest.majorVersion, 314) - - del authnRequest - - def test03(self): - """Get & set attributes of nodes of type string list.""" - - authnRequest = lasso.LibAuthnRequest() - - self.failUnlessEqual(authnRequest.respondWith, None) - - respondWith = lasso.StringList() - self.failUnlessEqual(len(respondWith), 0) - respondWith.append('first string') - self.failUnlessEqual(len(respondWith), 1) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[0], 'first string') - respondWith.append('second string') - self.failUnlessEqual(len(respondWith), 2) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - respondWith.append('third string') - self.failUnlessEqual(len(respondWith), 3) - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - authnRequest.respondWith = respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - del respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - respondWith = authnRequest.respondWith - self.failUnlessEqual(respondWith[0], 'first string') - self.failUnlessEqual(respondWith[1], 'second string') - self.failUnlessEqual(respondWith[2], 'third string') - del respondWith - self.failUnlessEqual(authnRequest.respondWith[0], 'first string') - self.failUnlessEqual(authnRequest.respondWith[1], 'second string') - self.failUnlessEqual(authnRequest.respondWith[2], 'third string') - authnRequest.respondWith = None - self.failUnlessEqual(authnRequest.respondWith, None) - - del authnRequest - - def test04(self): - """Get & set attributes of nodes of type node list.""" - - response = lasso.SamlpResponse() - - self.failUnlessEqual(response.assertion, None) - - assertions = lasso.NodeList() - self.failUnlessEqual(len(assertions), 0) - assertion1 = lasso.SamlAssertion() - assertion1.assertionId = 'assertion 1' - assertions.append(assertion1) - self.failUnlessEqual(len(assertions), 1) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - assertion2 = lasso.SamlAssertion() - assertion2.assertionId = 'assertion 2' - assertions.append(assertion2) - self.failUnlessEqual(len(assertions), 2) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - assertion3 = lasso.SamlAssertion() - assertion3.assertionId = 'assertion 3' - assertions.append(assertion3) - self.failUnlessEqual(len(assertions), 3) - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - response.assertion = assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - del assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - assertions = response.assertion - self.failUnlessEqual(assertions[0].assertionId, 'assertion 1') - self.failUnlessEqual(assertions[1].assertionId, 'assertion 2') - self.failUnlessEqual(assertions[2].assertionId, 'assertion 3') - del assertions - self.failUnlessEqual(response.assertion[0].assertionId, 'assertion 1') - self.failUnlessEqual(response.assertion[1].assertionId, 'assertion 2') - self.failUnlessEqual(response.assertion[2].assertionId, 'assertion 3') - response.assertion = None - self.failUnlessEqual(response.assertion, None) - - del response - - def test05(self): - """Get & set attributes of nodes of type XML list.""" - - authnRequest = lasso.LibAuthnRequest() - - self.failUnlessEqual(authnRequest.extension, None) - - actionString1 = """\ -<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> - <action>do 1</action> -</lib:Extension>""" - actionString2 = """\ -<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> - <action>do 2</action> -</lib:Extension>""" - actionString3 = """\ -<lib:Extension xmlns:lib="urn:liberty:iff:2003-08"> - <action>do 3</action> -</lib:Extension>""" - extension = lasso.StringList() - self.failUnlessEqual(len(extension), 0) - extension.append(actionString1) - self.failUnlessEqual(len(extension), 1) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[0], actionString1) - extension.append(actionString2) - self.failUnlessEqual(len(extension), 2) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - extension.append(actionString3) - self.failUnlessEqual(len(extension), 3) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - authnRequest.extension = extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - del extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - extension = authnRequest.extension - self.failUnlessEqual(extension[0], actionString1) - self.failUnlessEqual(extension[1], actionString2) - self.failUnlessEqual(extension[2], actionString3) - del extension - self.failUnlessEqual(authnRequest.extension[0], actionString1) - self.failUnlessEqual(authnRequest.extension[1], actionString2) - self.failUnlessEqual(authnRequest.extension[2], actionString3) - authnRequest.extension = None - self.failUnlessEqual(authnRequest.extension, None) - - del authnRequest - - def test06(self): - """Get & set attributes of nodes of type node.""" - - login = lasso.Login(lasso.Server()) - - self.failUnlessEqual(login.request, None) - login.request = lasso.LibAuthnRequest() - login.request.consent = lasso.libConsentObtained - self.failUnlessEqual(login.request.consent, lasso.libConsentObtained) - login.request = None - self.failUnlessEqual(login.request, None) - - del login - - class ServerTestCase(unittest.TestCase): def test01(self): """Server construction, dump & newFromDump.""" @@ -454,15 +251,14 @@ class IdentityTestCase(unittest.TestCase): self.failUnlessEqual(identityDump, newIdentityDump) -bindingSuite = unittest.makeSuite(BindingTestCase, 'test') serverSuite = unittest.makeSuite(ServerTestCase, 'test') loginSuite = unittest.makeSuite(LoginTestCase, 'test') logoutSuite = unittest.makeSuite(LogoutTestCase, 'test') defederationSuite = unittest.makeSuite(DefederationTestCase, 'test') identitySuite = unittest.makeSuite(IdentityTestCase, 'test') -allTests = unittest.TestSuite((bindingSuite, serverSuite, loginSuite, logoutSuite, - defederationSuite, identitySuite)) +allTests = unittest.TestSuite((serverSuite, loginSuite, logoutSuite, defederationSuite, + identitySuite)) if __name__ == '__main__': sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) diff --git a/python/tests/tests.py b/python/tests/tests.py index de3cf808..35c15691 100755 --- a/python/tests/tests.py +++ b/python/tests/tests.py @@ -1,14 +1,15 @@ #! /usr/bin/env python # -*- coding: UTF-8 -*- - - +# +# $Id$ +# # Python unit tests for Lasso library -# By: Frederic Peters <fpeters@entrouvert.com> -# Emmanuel Raviart <eraviart@entrouvert.com> # -# Copyright (C) 2004 Entr'ouvert +# Copyright (C) 2004, 2005 Entr'ouvert # http://lasso.entrouvert.org # +# Authors: See AUTHORS file. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -41,6 +42,7 @@ if not '../.libs' in sys.path: testSuites = ( + 'binding_tests', 'profiles_tests', 'errorchecking_tests', ) diff --git a/swig/Lasso-wsf.i b/swig/Lasso-wsf.i index 72096696..dc3cdaf5 100644 --- a/swig/Lasso-wsf.i +++ b/swig/Lasso-wsf.i @@ -7,11 +7,7 @@ * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Romain Chantereau <rchantereau@entrouvert.com> - * Nicolas Clapies <nclapies@entrouvert.com> - * Valery Febvre <vfebvre@easter-eggs.com> - * Frederic Peters <fpeters@entrouvert.com> - * Emmanuel Raviart <eraviart@entrouvert.com> + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/swig/Lasso.i b/swig/Lasso.i index 4f1d23db..264ade29 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -7,11 +7,7 @@ * Copyright (C) 2004, 2005 Entr'ouvert * http://lasso.entrouvert.org * - * Authors: Romain Chantereau <rchantereau@entrouvert.com> - * Nicolas Clapies <nclapies@entrouvert.com> - * Valery Febvre <vfebvre@easter-eggs.com> - * Frederic Peters <fpeters@entrouvert.com> - * Emmanuel Raviart <eraviart@entrouvert.com> + * Authors: See AUTHORS file. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by |