summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-01-25 18:33:10 +0100
committerGitHub <noreply@github.com>2021-01-25 18:33:10 +0100
commite61a0f2a1be030d28e8cb8fea9d703b7a34c12b8 (patch)
tree94e67b7e0f8c67c6d5d0b5865b8697eca83f868e
parent265dbbdd37af88395574564aeb3fd0350288a18c (diff)
parenta41af902675a07cd4772bb122c152547d6d570f7 (diff)
downloadgitlab-e61a0f2a1be030d28e8cb8fea9d703b7a34c12b8.tar.gz
Merge pull request #1263 from ePirat/epirat-fix-get-label
fix(api): add missing GetMixin to ProjectLabelManager
-rw-r--r--gitlab/v4/objects/__init__.py2
-rw-r--r--tools/functional/api/test_projects.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/gitlab/v4/objects/__init__.py b/gitlab/v4/objects/__init__.py
index edeff04..f42c60b 100644
--- a/gitlab/v4/objects/__init__.py
+++ b/gitlab/v4/objects/__init__.py
@@ -3601,7 +3601,7 @@ class ProjectLabel(SubscribableMixin, SaveMixin, ObjectDeleteMixin, RESTObject):
class ProjectLabelManager(
- ListMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
+ RetrieveMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager
):
_path = "/projects/%(project_id)s/labels"
_obj_cls = ProjectLabel
diff --git a/tools/functional/api/test_projects.py b/tools/functional/api/test_projects.py
index 3e88c0c..945a6ec 100644
--- a/tools/functional/api/test_projects.py
+++ b/tools/functional/api/test_projects.py
@@ -139,8 +139,11 @@ def test_project_housekeeping(project):
def test_project_labels(project):
label = project.labels.create({"name": "label", "color": "#778899"})
- label = project.labels.list()[0]
- assert len(project.labels.list()) == 1
+ labels = project.labels.list()
+ assert len(labels) == 1
+
+ label = project.labels.get("label")
+ assert label == labels[0]
label.new_name = "labelupdated"
label.save()