Tests: new python test for setEncryptionPrivateKeyWithPassword

This commit is contained in:
Benjamin Dauvergne 2010-06-10 13:38:08 +00:00
parent 2f7723348d
commit b6bdb0d33e
1 changed files with 12 additions and 0 deletions

View File

@ -274,6 +274,18 @@ class BindingTestCase(unittest.TestCase):
identity.federations['http://idp1.lasso.lan'].localNameIdentifier.content,
'first name id')
def test10(self):
'''Test Server.setEncryptionPrivateKeyWithPassword'''
pkey_path = os.path.join(
dataDir, 'idp5-saml2', 'private-key.pem')
server = lasso.Server(os.path.join(dataDir, 'idp5-saml2', 'metadata.xml'),
pkey_path)
# from file
server.setEncryptionPrivateKeyWithPassword(pkey_path)
# from buffer
server.setEncryptionPrivateKeyWithPassword(open(pkey_path).read())
# reset
server.setEncryptionPrivateKeyWithPassword()
bindingSuite = unittest.makeSuite(BindingTestCase, 'test')