Adding auxiliary test module.

refactor
blallo 2019-04-28 15:34:37 +02:00
parent 4e2cadaa92
commit c4046a83ff
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# coding: utf-8
import asyncio
from phi.ldap.async_model import (
Hackers,
Robots,
Congregations,
User,
Service,
build_heritage,
iter_children,
)
from phi.ldap.async_client import AsyncClient
async def dlv(h):
return [el async for el in build_heritage(h, User)]
cl = AsyncClient(
"ldap://localhost",
port=389,
encryption=True,
validate=True,
ca_cert="openldap/cert.pem",
username="root",
password="root",
base_dn="dc=unit,dc=macaomilano,dc=org",
attribute_id="cn",
)
h = Hackers(cl)
r = Robots(cl)
g = Congregations(cl)
# asyncio.run(dlv(h))