mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-21 17:04:21 +01:00
fix behavior of get_attributes()
* make sure it returns an ordered list in both python 2 and python 3
This commit is contained in:
parent
10747cff93
commit
79983c078f
@ -130,7 +130,9 @@ class Attributes:
|
||||
def get_backend_attributes(self, backend):
|
||||
if backend not in self.backends:
|
||||
raise WrongBackend(backend)
|
||||
return self.backend_attributes[backend].keys()
|
||||
ret = list(self.backend_attributes[backend].keys())
|
||||
ret.sort()
|
||||
return ret
|
||||
|
||||
def get_backend_key(self, backend):
|
||||
if backend not in self.backends:
|
||||
|
@ -42,6 +42,7 @@ class TestError(object):
|
||||
inv = Attributes('./tests/cfg/attributes.yml')
|
||||
ret = inv.get_backend_attributes('ldap')
|
||||
expected = ['shell', 'cn', 'userPassword', 'uidNumber', 'gidNumber', 'sn', 'home', 'givenName', 'email', 'uid']
|
||||
expected.sort()
|
||||
assert ret == expected
|
||||
|
||||
def testGetKey(self):
|
||||
|
Loading…
Reference in New Issue
Block a user