simple mock implementation of python-ldap
This project provides a mock replacement for python-ldap. It’s useful for any project that would like to write unit tests against LDAP code without relying on a running LDAP server.
The goal of mockldap is to provide a mock instance of LDAPObject in response to any call to ldap.initialize. In the general case, you would register return values for all LDAPObject calls that you expect the code under test to make. Your assertions would then verify that the tested code behaved correctly given this set of return values from the LDAP APIs.
As a convenience, the mock LDAPObject isn’t just a dumb mock object. The typical way to use mockldap is to provide some static directory content and then let LDAPObject generate real return values. This will only work for simple LDAP operations–this obviously isn’t a complete Python LDAP server implementation–but those simple operations tend to cover a lot of cases.
Debian: Michael Fladischer <FladischerMichael@fladi.at>
28 August 2014
Leaders and contributors
Resources and communication
This entry (in part or in whole) was last reviewed on 17 April 2018.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.
The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.