mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 09:24:21 +01:00
add unit test for get_groups
This commit is contained in:
parent
dc7f07ab38
commit
231b591d6a
@ -15,7 +15,7 @@ import ldap
|
||||
|
||||
cfg = {
|
||||
'module' : 'ldapcherry.backend.ldap',
|
||||
'groupdn' : 'ou=group,dc=example,dc=org',
|
||||
'groupdn' : 'ou=groups,dc=example,dc=org',
|
||||
'userdn' : 'ou=People,dc=example,dc=org',
|
||||
'binddn' : 'cn=dnscherry,dc=example,dc=org',
|
||||
'password' : 'password',
|
||||
@ -121,6 +121,12 @@ class TestError(object):
|
||||
expected = {'uid': 'jwatson', 'cn': 'John Watson', 'sn': 'watson'}
|
||||
assert ret == expected
|
||||
|
||||
def testGetUser(self):
|
||||
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
|
||||
ret = inv.get_groups('jwatson')
|
||||
expected = ['cn=itpeople,ou=Groups,dc=example,dc=org']
|
||||
assert ret == expected
|
||||
|
||||
def testSearchUser(self):
|
||||
inv = Backend(cfg, cherrypy.log, 'ldap', attr)
|
||||
ret = inv.search('smith')
|
||||
|
Loading…
Reference in New Issue
Block a user