Skip to content

Commit

Permalink
added test for LDAPObject.sasl_external_bind_s()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Sep 4, 2017
1 parent 4ec2378 commit 1bc1c6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $
11 changes: 10 additions & 1 deletion Tests/t_ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 1bc1c6c

Please sign in to comment.