diff options
| author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-27 12:23:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-27 12:23:11 +0100 |
| commit | 64f2360aecb082baac09cac716f88bd8cc6b443b (patch) | |
| tree | 724ae3c4d49af69a7345a916009867c35d976b01 /tests | |
| parent | 8d4c95358c9e61c1cfb89562252498093f56d269 (diff) | |
| parent | 68ff595967a5745b369a93d9d18fef48b65ebedb (diff) | |
| download | gitlab-64f2360aecb082baac09cac716f88bd8cc6b443b.tar.gz | |
Merge pull request #1718 from python-gitlab/jlvillal/project_groups
feat: add support for `projects.groups.list()`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/functional/api/test_projects.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/functional/api/test_projects.py b/tests/functional/api/test_projects.py index 3a317d5..4cd9515 100644 --- a/tests/functional/api/test_projects.py +++ b/tests/functional/api/test_projects.py @@ -311,3 +311,21 @@ def test_project_wiki(project): wiki.save() wiki.delete() assert len(project.wikis.list()) == 0 + + +def test_project_groups_list(gl, group): + """Test listing groups of a project""" + # Create a subgroup of our top-group, we will place our new project inside + # this group. + group2 = gl.groups.create( + {"name": "group2_proj", "path": "group2_proj", "parent_id": group.id} + ) + data = { + "name": "test-project-tpsg", + "namespace_id": group2.id, + } + project = gl.projects.create(data) + + groups = project.groups.list() + group_ids = set([x.id for x in groups]) + assert set((group.id, group2.id)) == group_ids |
