summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMathieu Parent <math.parent@gmail.com>2020-07-23 09:59:50 +0200
committerMathieu Parent <math.parent@gmail.com>2020-07-23 16:05:00 +0200
commit7c6e541dc2642740a6ec2d7ed7921aca41446b37 (patch)
tree70fda55d4989717841ebe789692a2c252a248b94 /tools
parent1606310a880f8a8a2a370db27511b57732caf178 (diff)
downloadgitlab-7c6e541dc2642740a6ec2d7ed7921aca41446b37.tar.gz
feat: add share/unshare group with group
Diffstat (limited to 'tools')
-rw-r--r--tools/python_test_v4.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index c43eebd..c30eeb6 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -255,8 +255,9 @@ group2 = gl.groups.create({"name": "group2", "path": "group2"})
p_id = gl.groups.list(search="group2")[0].id
group3 = gl.groups.create({"name": "group3", "path": "group3", "parent_id": p_id})
+group4 = gl.groups.create({"name": "group4", "path": "group4"})
-assert len(gl.groups.list()) == 3
+assert len(gl.groups.list()) == 4
assert len(gl.groups.list(search="oup1")) == 1
assert group3.parent_id == p_id
assert group2.subgroups.list()[0].id == group3.id
@@ -266,6 +267,16 @@ group1.members.create({"access_level": gitlab.const.GUEST_ACCESS, "user_id": use
group2.members.create({"access_level": gitlab.const.OWNER_ACCESS, "user_id": user2.id})
+group4.share(group1.id, gitlab.const.DEVELOPER_ACCESS)
+group4.share(group2.id, gitlab.const.MAINTAINER_ACCESS)
+# Reload group4 to have updated shared_with_groups
+group4 = gl.groups.get(group4.id)
+assert len(group4.shared_with_groups) == 2
+group4.unshare(group1.id)
+# Reload group4 to have updated shared_with_groups
+group4 = gl.groups.get(group4.id)
+assert len(group4.shared_with_groups) == 1
+
# User memberships (admin only)
memberships1 = user1.memberships.list()
assert len(memberships1) == 1