2

I'm trying to run the example for mocking with ldap3 from the documentation:

$ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ldap3 import Server, Connection, MOCK_SYNC
>>> server = Server('my_fake_server')
>>> connection = Connection(server, user='cn=my_user,ou=test,o=lab',password='my_password',client_strategy=MOCK_SYNC)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/ldap3/core/connection.py", line 270, in __init__
    self.strategy = MockSyncStrategy(self)
TypeError: 'NotImplementedType' object is not callable

Does anyone know why this fails?

loris
  • 450
  • 8
  • 20
  • Perhaps you are using a old version of ldap3. Which version is this? – Mauro Baraldi Nov 23 '18 at 18:51
  • 2
    Good point. It's ldap3 version 1.2.2, which is the current version available as a package for Debian 9.6. However, I see that, Debian being Debian, 1.2.2 is over 2 1/2 years old and the current version of ldap3 is 2.5.1. After updating to ldap3 2.5.1 via pip the error disappears. Thanks! – loris Nov 26 '18 at 08:57

0 Answers0