diff options
Diffstat (limited to 'bindings/python')
| -rwxr-xr-x | bindings/python/tests/profiles_tests.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bindings/python/tests/profiles_tests.py b/bindings/python/tests/profiles_tests.py index 9e71e82d..42cac2f9 100755 --- a/bindings/python/tests/profiles_tests.py +++ b/bindings/python/tests/profiles_tests.py @@ -401,15 +401,32 @@ class AttributeAuthorityTestCase(unittest.TestCase): assert aq.response.assertion[0].attributeStatement[0].attribute[0] assert aq.response.assertion[0].attributeStatement[0].attribute[0].attributeValue[0] +class LogoutTestCase(unittest.TestCase): + def test01(self): + '''Test parsing of a logout request with more than one session index''' + content = '''<samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="xxxx" Version="2.0" IssueInstant="2010-06-14T22:00:00"> + <samlp:Issuer>me</samlp:Issuer> + <samlp:SessionIndex>id1</samlp:SessionIndex> + <samlp:SessionIndex>id2</samlp:SessionIndex> + <samlp:SessionIndex>id3</samlp:SessionIndex> + </samlp:LogoutRequest>''' + + node = lasso.Samlp2LogoutRequest.newFromXmlNode(content) + assert isinstance(node, lasso.Samlp2LogoutRequest) + print node.sessionIndex + assert node.sessionIndex == 'id3' + assert node.sessionIndexes == ('id1', 'id2', 'id3') + 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') attributeSuite = unittest.makeSuite(AttributeAuthorityTestCase, 'test') +logoutSuite = unittest.makeSuite(LogoutTestCase, 'test') allTests = unittest.TestSuite((serverSuite, loginSuite, logoutSuite, defederationSuite, - identitySuite, attributeSuite)) + identitySuite, attributeSuite, logoutSuite)) if __name__ == '__main__': sys.exit(not unittest.TextTestRunner(verbosity = 2).run(allTests).wasSuccessful()) |
