1
0
Fork 0
mirror of https://github.com/kakwa/ldapcherry synced 2025-07-03 20:07:42 +02:00

implementing a method to get groups to remove

* implement a way to remove roles from a user
  without removing groups of roles the user keeps
This commit is contained in:
kakwa 2015-06-08 22:50:54 +02:00
parent bc85d07921
commit 556d1f744b
2 changed files with 53 additions and 0 deletions

View file

@ -58,6 +58,15 @@ class TestError(object):
else:
raise AssertionError("expected an exception")
def testGroupsRemove(self):
inv = Roles('./tests/cfg/roles.yml')
groups = inv.get_groups_to_remove(
['admin-lv2', 'admin-lv3', 'users'],
['admin-lv2']
)
expected = {'ad': Set(['Administrators', 'Domain Controllers']), 'ldap': Set(['cn=nagios admins,ou=group,dc=example,dc=com', 'cn=puppet admins,ou=group,dc=example,dc=com', 'cn=dns admins,ou=group,dc=example,dc=com'])}
assert groups == expected
def testGetGroup(self):
inv = Roles('./tests/cfg/roles.yml')
res = inv.get_groups('users')