phi/test/aux_async_model.py

36 lines
616 B
Python
Raw Normal View History

2019-04-28 15:34:37 +02:00
# 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))