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:
parent
bc85d07921
commit
556d1f744b
2 changed files with 53 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue