Skip to content

Commit 57bb67a

Browse files
nejchJohnVillalovos
authored andcommitted
test(groups): enable group transfer tests
1 parent 868f243 commit 57bb67a

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

tests/functional/api/test_groups.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,19 @@ def test_group_hooks(group):
233233
hook.delete()
234234

235235

236-
@pytest.mark.skip(reason="Pending #1807")
237236
def test_group_transfer(gl, group):
238-
transfer_group = gl.groups.create({"name": "transfer-test-group"})
239-
assert group.namespace["path"] != group.full_path
237+
transfer_group = gl.groups.create(
238+
{"name": "transfer-test-group", "path": "transfer-test-group"}
239+
)
240+
transfer_group = gl.groups.get(transfer_group.id)
241+
assert transfer_group.parent_id != group.id
240242

241243
transfer_group.transfer(group.id)
242244

243-
transferred_group = gl.projects.get(transfer_group.id)
244-
assert transferred_group.namespace["path"] == group.full_path
245+
transferred_group = gl.groups.get(transfer_group.id)
246+
assert transferred_group.parent_id == group.id
245247

246248
transfer_group.transfer()
247249

248-
transferred_group = gl.projects.get(transfer_group.id)
250+
transferred_group = gl.groups.get(transfer_group.id)
249251
assert transferred_group.path == transferred_group.full_path

tests/functional/fixtures/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
GITLAB_IMAGE=gitlab/gitlab-ce
2-
GITLAB_TAG=14.5.2-ce.0
2+
GITLAB_TAG=14.6.2-ce.0

tests/unit/objects/test_groups.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ def resp_create_import(accepted_content):
9999
def resp_transfer_group():
100100
with responses.RequestsMock() as rsps:
101101
rsps.add(
102-
method=responses.PUT,
102+
method=responses.POST,
103103
url="http://localhost/api/v4/groups/1/transfer",
104104
json=content,
105105
content_type="application/json",
106106
status=200,
107107
match=[
108-
responses.matchers.json_params_matcher({"namespace": "test-namespace"})
108+
responses.matchers.json_params_matcher({"group_id": "test-namespace"})
109109
],
110110
)
111111
yield rsps
@@ -170,7 +170,6 @@ def test_refresh_group_import_status(group, resp_groups):
170170
assert group_import.import_status == "finished"
171171

172172

173-
@pytest.mark.skip("Pending #1807")
174173
def test_transfer_group(gl, resp_transfer_group):
175174
group = gl.groups.get(1, lazy=True)
176175
group.transfer("test-namespace")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy