From c4046a83ff0dee991352b80f9da5f79d73047b9f Mon Sep 17 00:00:00 2001 From: Blallo Date: Sun, 28 Apr 2019 15:34:37 +0200 Subject: [PATCH] Adding auxiliary test module. --- test/aux_async_model.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/aux_async_model.py diff --git a/test/aux_async_model.py b/test/aux_async_model.py new file mode 100644 index 0000000..875bfe8 --- /dev/null +++ b/test/aux_async_model.py @@ -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))