与ldap3的模拟:TypeError:“ NotImplementedType”对象不可调用

时间:2018-11-23 09:34:58

标签: python mocking ldap3

我正在尝试使用the documentation中的ldap3进行模拟的示例:

$ 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

有人知道为什么失败吗?

0 个答案:

没有答案