tldap.test package¶
Submodules¶
tldap.test.slapd module¶
Utilities for starting up a test slapd server and talking to it with ldapsearch/ldapadd.
- class tldap.test.slapd.Slapd[source]¶
Bases:
object
Controller class for a slapd instance, OpenLDAP’s server.
This class creates a temporary data store for slapd, runs it on a private port, and initialises it with a top-level dc and the root user.
When a reference to an instance of this class is lost, the slapd server is shut down.
- PATH_LDAPADD = 'ldapadd'¶
- PATH_LDAPSEARCH = 'ldapsearch'¶
- PATH_SCHEMA_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/python-tldap/checkouts/latest/tldap/test/ldap_schemas/'¶
- PATH_SLAPD = 'slapd'¶
- PATH_SLAP_TEST = 'slaptest'¶
- TEST_UTILS_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/python-tldap/checkouts/latest/tldap/test'¶
- ldap_add(ldif: str, extra_args: List | None = None) None [source]¶
Runs ldapadd on this slapd instance, passing it the ldif content
- ldap_search(base: str | None = None, filter: str = '(objectClass=*)', attrs: List[str] | None = None, scope: str = 'sub', extra_args: List[str] | None = None)[source]¶
- tldap.test.slapd.mkdirs(path: str) str [source]¶
Creates the directory path unless it already exists