1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 09:24:21 +01:00

adding unit test for _parse_params

This commit is contained in:
kakwa 2015-07-05 22:35:45 +02:00
parent 287ef63215
commit b8f37aa545

View File

@ -174,6 +174,14 @@ class TestError(object):
app._adduser(form) app._adduser(form)
app._deleteuser('test') app._deleteuser('test')
def testParse(self):
app = LdapCherry()
form = {'attr.val': 'val', 'role.id': 'id', 'group.ldap.id': 'id'}
ret = app._parse_params(form)
expected = {'attrs': {'val': 'val'}, 'roles': {'id': 'id'}, 'groups': {'ldap': ['id']}}
assert expected == ret
def testModifUser(self): def testModifUser(self):
app = LdapCherry() app = LdapCherry()
loadconf('./tests/cfg/ldapcherry_test.ini', app) loadconf('./tests/cfg/ldapcherry_test.ini', app)