summaryrefslogtreecommitdiff
path: root/gitlab/tests/test_gitlab.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2020-03-22 06:03:53 -0400
committerNejc Habjan <hab.nejc@gmail.com>2020-03-22 08:50:05 -0400
commit8c037712a53c1c54e46298fbb93441d9b7a7144a (patch)
treec4795b86ce7ae1afc0e5e6af0457e0ef76be326f /gitlab/tests/test_gitlab.py
parent82deb7dbe261c4b42a9c45a5b85a2c767f3a8218 (diff)
downloadgitlab-8c037712a53c1c54e46298fbb93441d9b7a7144a.tar.gz
test: create separate module for commit tests
Diffstat (limited to 'gitlab/tests/test_gitlab.py')
-rw-r--r--gitlab/tests/test_gitlab.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py
index 591f166..d104c7d 100644
--- a/gitlab/tests/test_gitlab.py
+++ b/gitlab/tests/test_gitlab.py
@@ -843,50 +843,6 @@ class TestGitlab(unittest.TestCase):
self.gl.users.get(1, lazy=True).activate()
self.gl.users.get(1, lazy=True).deactivate()
- def test_commit_revert(self):
- @urlmatch(
- scheme="http",
- netloc="localhost",
- path="/api/v4/projects/1/repository/commits/6b2257ea",
- method="get",
- )
- def resp_get_commit(url, request):
- headers = {"content-type": "application/json"}
- content = """{
- "id": "6b2257eabcec3db1f59dafbd84935e3caea04235",
- "short_id": "6b2257ea",
- "title": "Initial commit"
- }"""
- content = content.encode("utf-8")
- return response(200, content, headers, None, 5, request)
-
- @urlmatch(
- scheme="http",
- netloc="localhost",
- path="/api/v4/projects/1/repository/commits/6b2257ea",
- method="post",
- )
- def resp_revert_commit(url, request):
- headers = {"content-type": "application/json"}
- content = """{
- "id": "8b090c1b79a14f2bd9e8a738f717824ff53aebad",
- "short_id": "8b090c1b",
- "title":"Revert \\"Initial commit\\""
- }"""
- content = content.encode("utf-8")
- return response(200, content, headers, None, 5, request)
-
- with HTTMock(resp_get_commit):
- project = self.gl.projects.get(1, lazy=True)
- commit = project.commits.get("6b2257ea")
- self.assertEqual(commit.short_id, "6b2257ea")
- self.assertEqual(commit.title, "Initial commit")
-
- with HTTMock(resp_revert_commit):
- revert_commit = commit.revert(branch="master")
- self.assertEqual(revert_commit["short_id"], "8b090c1b")
- self.assertEqual(revert_commit["title"], 'Revert "Initial commit"')
-
def test_update_submodule(self):
@urlmatch(
scheme="http", netloc="localhost", path="/api/v4/projects/1$", method="get"