mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 01:14:21 +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)
|
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)
|
||||||
|
@ -63,8 +63,11 @@ class TestError(object):
|
|||||||
inv = Roles('./tests/cfg/roles.yml')
|
inv = Roles('./tests/cfg/roles.yml')
|
||||||
groups = {
|
groups = {
|
||||||
'ad' : ['Domain Users', 'Domain Users 2'],
|
'ad' : ['Domain Users', 'Domain Users 2'],
|
||||||
'ldap': ['cn=users,ou=group,dc=example,dc=com']
|
'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'])}
|
||||||
expected = {'unusedgroups': {'ad': Set(['Domain Users 2'])}, 'roles': Set(['users'])}
|
|
||||||
assert inv.get_roles(groups) == expected
|
assert inv.get_roles(groups) == expected
|
||||||
|
Loading…
Reference in New Issue
Block a user