mirror of
https://github.com/kakwa/ldapcherry
synced 2024-12-22 04:40:03 +01:00
more complex unit test for get_roles
This commit is contained in:
parent
991f8ee72d
commit
19f98aa664
@ -26,3 +26,14 @@ groups = {
|
||||
|
||||
print inv.get_roles(groups)
|
||||
|
||||
groups = {
|
||||
'ad' : ['Domain Users', 'Domain Users 2'],
|
||||
'ldap': ['cn=users,ou=group,dc=example,dc=com',
|
||||
'cn=nagios admins,ou=group,dc=example,dc=com',
|
||||
'cn=developpers,ou=group,dc=example,dc=com',
|
||||
],
|
||||
'toto': ['not a group'],
|
||||
}
|
||||
|
||||
|
||||
print inv.get_roles(groups)
|
||||
|
@ -62,9 +62,12 @@ class TestError(object):
|
||||
def testGetRole(self):
|
||||
inv = Roles('./tests/cfg/roles.yml')
|
||||
groups = {
|
||||
'ad' : ['Domain Users', 'Domain Users 2'],
|
||||
'ldap': ['cn=users,ou=group,dc=example,dc=com']
|
||||
}
|
||||
|
||||
expected = {'unusedgroups': {'ad': Set(['Domain Users 2'])}, 'roles': Set(['users'])}
|
||||
'ad' : ['Domain Users', 'Domain Users 2'],
|
||||
'ldap': ['cn=users,ou=group,dc=example,dc=com',
|
||||
'cn=nagios admins,ou=group,dc=example,dc=com',
|
||||
'cn=developpers,ou=group,dc=example,dc=com',
|
||||
],
|
||||
'toto': ['not a group'],
|
||||
}
|
||||
expected = {'unusedgroups': {'toto': Set(['not a group']), 'ad': Set(['Domain Users 2'])}, 'roles': Set(['developpers', 'admin-lv2'])}
|
||||
assert inv.get_roles(groups) == expected
|
||||
|
Loading…
x
Reference in New Issue
Block a user