mirror of
https://github.com/kakwa/ldapcherry
synced 2025-07-03 03:47:35 +02:00
implement search
This commit is contained in:
parent
c9b971e8b0
commit
53660ee1d2
4 changed files with 38 additions and 8 deletions
|
@ -30,12 +30,24 @@ class TestError(object):
|
|||
expected = Set(['ldap', 'ad'])
|
||||
assert ret == expected
|
||||
|
||||
def testGetSearchAttributes(self):
|
||||
inv = Attributes('./tests/cfg/attributes.yml')
|
||||
ret = inv.get_search_attributes()
|
||||
expected = {'first-name': 'First Name', 'cn': 'Display Name', 'name': 'Name', 'uid': 'UID', 'email': 'Name'}
|
||||
assert ret == expected
|
||||
|
||||
def testGetBackendAttributes(self):
|
||||
inv = Attributes('./tests/cfg/attributes.yml')
|
||||
ret = inv.get_backend_attributes('ldap')
|
||||
expected = ['shell', 'cn', 'uid', 'uidNumber', 'gidNumber', 'home', 'userPassword', 'givenName', 'email', 'sn']
|
||||
assert ret == expected
|
||||
|
||||
def testGetKey(self):
|
||||
inv = Attributes('./tests/cfg/attributes.yml')
|
||||
ret = inv.get_key()
|
||||
expected = 'uid'
|
||||
assert ret == expected
|
||||
|
||||
def testWrongGetBackendAttributes(self):
|
||||
inv = Attributes('./tests/cfg/attributes.yml')
|
||||
try:
|
||||
|
@ -44,7 +56,6 @@ class TestError(object):
|
|||
return
|
||||
else:
|
||||
raise AssertionError("expected an exception")
|
||||
|
||||
|
||||
def testNoFile(self):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue