Skip to content

Commit

Permalink
test(groups): enable group transfer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Jan 14, 2022
1 parent 868f243 commit 57bb67a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
14 changes: 8 additions & 6 deletions tests/functional/api/test_groups.py
Expand Up @@ -233,17 +233,19 @@ def test_group_hooks(group):
hook.delete()


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

transfer_group.transfer(group.id)

transferred_group = gl.projects.get(transfer_group.id)
assert transferred_group.namespace["path"] == group.full_path
transferred_group = gl.groups.get(transfer_group.id)
assert transferred_group.parent_id == group.id

transfer_group.transfer()

transferred_group = gl.projects.get(transfer_group.id)
transferred_group = gl.groups.get(transfer_group.id)
assert transferred_group.path == transferred_group.full_path
2 changes: 1 addition & 1 deletion tests/functional/fixtures/.env
@@ -1,2 +1,2 @@
GITLAB_IMAGE=gitlab/gitlab-ce
GITLAB_TAG=14.5.2-ce.0
GITLAB_TAG=14.6.2-ce.0
5 changes: 2 additions & 3 deletions tests/unit/objects/test_groups.py
Expand Up @@ -99,13 +99,13 @@ def resp_create_import(accepted_content):
def resp_transfer_group():
with responses.RequestsMock() as rsps:
rsps.add(
method=responses.PUT,
method=responses.POST,
url="http://localhost/api/v4/groups/1/transfer",
json=content,
content_type="application/json",
status=200,
match=[
responses.matchers.json_params_matcher({"namespace": "test-namespace"})
responses.matchers.json_params_matcher({"group_id": "test-namespace"})
],
)
yield rsps
Expand Down Expand Up @@ -170,7 +170,6 @@ def test_refresh_group_import_status(group, resp_groups):
assert group_import.import_status == "finished"


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

0 comments on commit 57bb67a

Please sign in to comment.