adding unit test for _parse_params

This commit is contained in:
kakwa 2015-07-05 22:35:45 +02:00
parent 287ef63215
commit b8f37aa545
1 changed files with 8 additions and 0 deletions

View File

@ -174,6 +174,14 @@ class TestError(object):
app._adduser(form)
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):
app = LdapCherry()
loadconf('./tests/cfg/ldapcherry_test.ini', app)