fix use_tls flag

This commit is contained in:
Chris McDonough 2012-02-26 02:58:00 -05:00
parent e5c62a3946
commit d1f800739f
3 changed files with 11 additions and 1 deletions

6
CHANGES.txt Normal file
View File

@ -0,0 +1,6 @@
Next release
------------
- Fix ``use_tls`` flag to ConnectionManager; it previously was always set
``False`` no matter what was passed.

View File

@ -129,7 +129,7 @@ class ConnectionManager(object):
self.bind = bind
self.passwd = passwd
self._pool_lock = RLock()
self.use_tls = False
self.use_tls = use_tls
self.timeout = timeout
self.connector_cls = connector_cls
self.use_pool = use_pool

View File

@ -118,6 +118,10 @@ class LDAPWorker(threading.Thread):
class TestLDAPSQLAuth(unittest.TestCase):
def test_ctor_args(self):
pool = ConnectionManager('ldap://localhost', use_tls=True)
self.assertEqual(pool.use_tls, True)
def test_pool(self):
dn = 'uid=adminuser,ou=logins,dc=mozilla'
passwd = 'adminuser'