From 1bc1c6c93f9ddf378189a4bae6a263e1f1669bdf Mon Sep 17 00:00:00 2001 From: stroeder Date: Mon, 4 Sep 2017 14:59:57 +0000 Subject: [PATCH] added test for LDAPObject.sasl_external_bind_s() --- CHANGES | 4 ++-- Tests/t_ldapobject.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 5384a13..197967f 100644 --- a/CHANGES +++ b/CHANGES @@ -8,7 +8,7 @@ Lib/ to LDAPObject.sasl_interactive_bind_s() Tests/ -* +* added test for LDAPObject.sasl_external_bind_s() ---------------------------------------------------------------- Released 2.4.42 2017-09-04 @@ -1488,4 +1488,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.460 2017/09/04 14:59:12 stroeder Exp $ +$Id: CHANGES,v 1.461 2017/09/04 14:59:57 stroeder Exp $ diff --git a/Tests/t_ldapobject.py b/Tests/t_ldapobject.py index e9df53c..e8fe6ac 100644 --- a/Tests/t_ldapobject.py +++ b/Tests/t_ldapobject.py @@ -4,7 +4,7 @@ See https://www.python-ldap.org/ for details. -$Id: t_ldapobject.py,v 1.9 2017/09/04 07:47:29 stroeder Exp $ +$Id: t_ldapobject.py,v 1.10 2017/09/04 14:59:57 stroeder Exp $ """ import os @@ -175,6 +175,15 @@ def test_invalid_credentials(self): else: self.fail("expected INVALID_CREDENTIALS, got %r" % r) + def test_sasl_extenal_bind_s(self): + l = self.ldap_object_class(self.server.ldapi_uri) + l.sasl_external_bind_s() + self.assertEqual(l.whoami_s(), 'dn:'+self.server.root_dn.lower()) + authz_id = 'dn:cn=Foo2,%s' % (self.server.suffix) + l = self.ldap_object_class(self.server.ldapi_uri) + l.sasl_external_bind_s(authz_id=authz_id) + self.assertEqual(l.whoami_s(), authz_id.lower()) + class Test02_ReconnectLDAPObject(Test01_SimpleLDAPObject): """