add unit test for get_user

This commit is contained in:
kakwa 2015-05-28 09:56:25 +02:00
parent 0f97d1d07c
commit 1acd48c332
1 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,11 @@ class TestError(object):
else:
raise AssertionError("expected an exception")
def testGetUser(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
ret = inv.get_user('jwatson')
expected = {'sn': 'watson', 'uid': 'jwatson', 'cn': 'John Watson'}
assert ret == expected
def testAddUserMissingMustAttribute(self):
inv = Backend(cfg, cherrypy.log, 'ldap', attr)