Test for create_new_.
This commit is contained in:
parent
f05fe8a0d5
commit
3454c194b1
|
@ -18,6 +18,7 @@ from phi.async_ldap.model import (
|
||||||
Robots,
|
Robots,
|
||||||
Congregations,
|
Congregations,
|
||||||
Service,
|
Service,
|
||||||
|
create_new_,
|
||||||
User,
|
User,
|
||||||
Group,
|
Group,
|
||||||
)
|
)
|
||||||
|
@ -375,6 +376,23 @@ def test_Congregations_children(client_fixture_multi):
|
||||||
assert GROUP_LIST == c.children
|
assert GROUP_LIST == c.children
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_create_new_(client_fixture):
|
||||||
|
self = Namespace()
|
||||||
|
self.dn = f"uid=test,ou=Tests,{BASE_DN}"
|
||||||
|
self.client = client_fixture
|
||||||
|
self.object_class = ["a", "b", "c"]
|
||||||
|
ENTRY_DICT = {"attr1": "val1", "attr2": "val2", "attr3": "val3", "attr4": "val4"}
|
||||||
|
|
||||||
|
res = await create_new_(self, **ENTRY_DICT)
|
||||||
|
|
||||||
|
assert res is not None
|
||||||
|
assert client_fixture.called_with_args["add"]["args"][0] == res
|
||||||
|
assert res["objectClass"] == self.object_class
|
||||||
|
for k, v in ENTRY_DICT.items():
|
||||||
|
assert v == res[k][0]
|
||||||
|
|
||||||
|
|
||||||
def test_User(client_fixture):
|
def test_User(client_fixture):
|
||||||
c = User("conte_mascetti", client_fixture)
|
c = User("conte_mascetti", client_fixture)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user