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.
This commit is contained in:
Emmanuel Raviart 2005-01-15 13:11:25 +00:00
parent bb27a8d598
commit e8de39bae0
13 changed files with 421 additions and 285 deletions

70
AUTHORS
View File

@ -9,53 +9,43 @@ Authors
(see README_ for details)
Main Developers
===============
Core
====
- Nicolas Clapiès (initial developer) <nclapies@entrouvert.com>
- Valéry Febvre (lead developer) <vfebvre@easter-eggs.com>
- Nicolas Clapiès <nclapies@entrouvert.com>
- Valéry Febvre <vfebvre@easter-eggs.com>
- Frédéric Péters <fpeters@entrouvert.com>
SWIG Bindings
=============
- Emmanuel Raviart <eraviart@entrouvert.com>
with help from:
- 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
Unit Tests
==========
- Emmanuel Raviart <eraviart@entrouvert.com>
with help from:
- Frédéric Péters <fpeters@entrouvert.com>
Packaging
=========
- 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
=============
- Benjamin Poussin (initial developer) <poussin@codelutin.com>
- Emmanuel Raviart <eraviart@entrouvert.com>
Java Unit Tests
===============
- Emmanuel Raviart <eraviart@entrouvert.com>
Python Bindings
===============
- Nicolas Clapiès <nclapies@entrouvert.com>
- Valéry Febvre <vfebvre@easter-eggs.com>
Python Unit Tests
=================
- Emmanuel Raviart <eraviart@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>

View File

@ -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.*;

View File

@ -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;

View File

@ -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.

View File

@ -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);

View File

@ -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);

View File

@ -1,5 +1,7 @@
# -*- coding: UTF-8 -*-
#
# $Id$
#
# XmlTestRunner
#
# Copyright (C) 2004 Entr'ouvert

249
python/tests/binding_tests.py Executable file
View File

@ -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())

View File

@ -1,14 +1,15 @@
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Python unit tests for Lasso library
# By: Frederic Peters <fpeters@entrouvert.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
#
# Copyright (C) 2004 Entr'ouvert
# $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

View File

@ -1,14 +1,15 @@
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Python unit tests for Lasso library
# By: Frederic Peters <fpeters@entrouvert.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
#
# Copyright (C) 2004 Entr'ouvert
# $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
@ -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())

View File

@ -1,14 +1,15 @@
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
# Python unit tests for Lasso library
# By: Frederic Peters <fpeters@entrouvert.com>
# Emmanuel Raviart <eraviart@entrouvert.com>
#
# Copyright (C) 2004 Entr'ouvert
# $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
@ -41,6 +42,7 @@ if not '../.libs' in sys.path:
testSuites = (
'binding_tests',
'profiles_tests',
'errorchecking_tests',
)

View File

@ -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

View File

@ -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