summaryrefslogtreecommitdiff
path: root/tests/unit/objects/test_merge_request_pipelines.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-01 01:04:53 +0100
committerGitHub <noreply@github.com>2021-12-01 01:04:53 +0100
commit8d76826fa64460e504acc5924f859f8dbc246b42 (patch)
tree083fefada982c795e2415092794db429abb0c184 /tests/unit/objects/test_merge_request_pipelines.py
parent5a1678f43184bd459132102cc13cf8426fe0449d (diff)
parent86ab04e54ea4175f10053decfad5086cda7aa024 (diff)
downloadgitlab-master.tar.gz
Merge pull request #1723 from python-gitlab/jlvillal/dead_mastermaster
Close-out `master` branch
Diffstat (limited to 'tests/unit/objects/test_merge_request_pipelines.py')
-rw-r--r--tests/unit/objects/test_merge_request_pipelines.py53
1 files changed, 0 insertions, 53 deletions
diff --git a/tests/unit/objects/test_merge_request_pipelines.py b/tests/unit/objects/test_merge_request_pipelines.py
deleted file mode 100644
index 04b04a8..0000000
--- a/tests/unit/objects/test_merge_request_pipelines.py
+++ /dev/null
@@ -1,53 +0,0 @@
-"""
-GitLab API: https://docs.gitlab.com/ee/api/merge_requests.html#list-mr-pipelines
-"""
-import pytest
-import responses
-
-from gitlab.v4.objects import ProjectMergeRequestPipeline
-
-pipeline_content = {
- "id": 1,
- "sha": "959e04d7c7a30600c894bd3c0cd0e1ce7f42c11d",
- "ref": "master",
- "status": "success",
-}
-
-
-@pytest.fixture()
-def resp_list_merge_request_pipelines():
- with responses.RequestsMock() as rsps:
- rsps.add(
- method=responses.GET,
- url="http://localhost/api/v4/projects/1/merge_requests/1/pipelines",
- json=[pipeline_content],
- content_type="application/json",
- status=200,
- )
- yield rsps
-
-
-@pytest.fixture()
-def resp_create_merge_request_pipeline():
- with responses.RequestsMock() as rsps:
- rsps.add(
- method=responses.POST,
- url="http://localhost/api/v4/projects/1/merge_requests/1/pipelines",
- json=pipeline_content,
- content_type="application/json",
- status=201,
- )
- yield rsps
-
-
-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], 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, ProjectMergeRequestPipeline)
- assert pipeline.sha == pipeline_content["sha"]