summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-01-14 01:49:27 +0100
committerJohn Villalovos <john@sodarock.com>2022-01-13 17:17:20 -0800
commit57bb67ae280cff8ac6e946cd3f3797574a574f4a (patch)
treede4950652dd31d00ef688b6cccbe91b4676292db
parent868f2432cae80578d99db91b941332302dd31c89 (diff)
downloadgitlab-57bb67ae280cff8ac6e946cd3f3797574a574f4a.tar.gz
test(groups): enable group transfer tests
-rw-r--r--tests/functional/api/test_groups.py14
-rw-r--r--tests/functional/fixtures/.env2
-rw-r--r--tests/unit/objects/test_groups.py5
3 files changed, 11 insertions, 10 deletions
diff --git a/tests/functional/api/test_groups.py b/tests/functional/api/test_groups.py
index 584ea83..b613055 100644
--- a/tests/functional/api/test_groups.py
+++ b/tests/functional/api/test_groups.py
@@ -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
diff --git a/tests/functional/fixtures/.env b/tests/functional/fixtures/.env
index 30abd5c..bcfd357 100644
--- a/tests/functional/fixtures/.env
+++ b/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
diff --git a/tests/unit/objects/test_groups.py b/tests/unit/objects/test_groups.py
index b3e753e..2c91d38 100644
--- a/tests/unit/objects/test_groups.py
+++ b/tests/unit/objects/test_groups.py
@@ -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
@@ -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")