summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-02-26 20:28:54 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-02-26 20:34:59 +0100
commitf12841fd5bd88f879906386655620c5d0c592470 (patch)
tree8b62a79be239d56d5358d3bef04ebe80385f7e53
parentdba828b9cfca03f6d339329f9b7d49878cf9e11a (diff)
downloadgitlab-feat/mr-pipeline-manager.tar.gz
chore(api): make class names consistent in MR resourcesfeat/mr-pipeline-manager
-rw-r--r--docs/gl_objects/mrs.rst4
-rw-r--r--gitlab/tests/objects/test_merge_request_pipelines.py8
-rw-r--r--gitlab/v4/objects/merge_requests.py4
-rw-r--r--gitlab/v4/objects/pipelines.py10
4 files changed, 13 insertions, 13 deletions
diff --git a/docs/gl_objects/mrs.rst b/docs/gl_objects/mrs.rst
index 4fdadf0..0b23835 100644
--- a/docs/gl_objects/mrs.rst
+++ b/docs/gl_objects/mrs.rst
@@ -190,8 +190,8 @@ Reference
* v4 API:
- + :class:`gitlab.v4.objects.MergeRequestPipeline`
- + :class:`gitlab.v4.objects.MergeRequestPipelineManager`
+ + :class:`gitlab.v4.objects.ProjectMergeRequestPipeline`
+ + :class:`gitlab.v4.objects.ProjectMergeRequestPipelineManager`
+ :attr:`gitlab.v4.objects.ProjectMergeRequest.pipelines`
* GitLab API: https://docs.gitlab.com/ee/api/merge_requests.html#list-mr-pipelines
diff --git a/gitlab/tests/objects/test_merge_request_pipelines.py b/gitlab/tests/objects/test_merge_request_pipelines.py
index b22a6c1..4500163 100644
--- a/gitlab/tests/objects/test_merge_request_pipelines.py
+++ b/gitlab/tests/objects/test_merge_request_pipelines.py
@@ -6,7 +6,7 @@ import re
import pytest
import responses
-from gitlab.v4.objects import MergeRequestPipeline
+from gitlab.v4.objects import ProjectMergeRequestPipeline
pipeline_content = {
"id": 1,
@@ -49,18 +49,18 @@ def test_merge_requests_pipelines_deprecated_raises_warning(
pipelines = project.mergerequests.get(1, lazy=True).pipelines()
assert len(pipelines) == 1
- assert isinstance(pipelines[0], MergeRequestPipeline)
+ assert isinstance(pipelines[0], ProjectMergeRequestPipeline)
assert pipelines[0].sha == pipeline_content["sha"]
def test_list_merge_requests_pipelines(project, resp_list_merge_request_pipelines):
pipelines = project.mergerequests.get(1, lazy=True).pipelines.list()
assert len(pipelines) == 1
- assert isinstance(pipelines[0], MergeRequestPipeline)
+ assert isinstance(pipelines[0], ProjectMergeRequestPipeline)
assert pipelines[0].sha == pipeline_content["sha"]
def test_create_merge_requests_pipelines(project, resp_create_merge_request_pipeline):
pipeline = project.mergerequests.get(1, lazy=True).pipelines.create()
- assert isinstance(pipeline, MergeRequestPipeline)
+ assert isinstance(pipeline, ProjectMergeRequestPipeline)
assert pipeline.sha == pipeline_content["sha"]
diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py
index a1ef026..3bb848d 100644
--- a/gitlab/v4/objects/merge_requests.py
+++ b/gitlab/v4/objects/merge_requests.py
@@ -25,7 +25,7 @@ from .events import (
ProjectMergeRequestResourceLabelEventManager,
ProjectMergeRequestResourceMilestoneEventManager,
)
-from .pipelines import MergeRequestPipelineManager
+from .pipelines import ProjectMergeRequestPipelineManager
__all__ = [
@@ -120,7 +120,7 @@ class ProjectMergeRequest(
("diffs", "ProjectMergeRequestDiffManager"),
("discussions", "ProjectMergeRequestDiscussionManager"),
("notes", "ProjectMergeRequestNoteManager"),
- ("pipelines", "MergeRequestPipelineManager"),
+ ("pipelines", "ProjectMergeRequestPipelineManager"),
("resourcelabelevents", "ProjectMergeRequestResourceLabelEventManager"),
("resourcemilestoneevents", "ProjectMergeRequestResourceMilestoneEventManager"),
)
diff --git a/gitlab/v4/objects/pipelines.py b/gitlab/v4/objects/pipelines.py
index 8024ad1..cb12d8e 100644
--- a/gitlab/v4/objects/pipelines.py
+++ b/gitlab/v4/objects/pipelines.py
@@ -17,8 +17,8 @@ from gitlab.mixins import (
__all__ = [
- "MergeRequestPipeline",
- "MergeRequestPipelineManager",
+ "ProjectMergeRequestPipeline",
+ "ProjectMergeRequestPipelineManager",
"ProjectPipeline",
"ProjectPipelineManager",
"ProjectPipelineJob",
@@ -34,13 +34,13 @@ __all__ = [
]
-class MergeRequestPipeline(RESTObject):
+class ProjectMergeRequestPipeline(RESTObject):
pass
-class MergeRequestPipelineManager(CreateMixin, ListMixin, RESTManager):
+class ProjectMergeRequestPipelineManager(CreateMixin, ListMixin, RESTManager):
_path = "/projects/%(project_id)s/merge_requests/%(mr_iid)s/pipelines"
- _obj_cls = MergeRequestPipeline
+ _obj_cls = ProjectMergeRequestPipeline
_from_parent_attrs = {"project_id": "project_id", "mr_iid": "iid"}
_create_attrs = (tuple(), tuple())