summaryrefslogtreecommitdiff
path: root/tests/functional/api
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-10-09 15:35:32 +0200
committerNejc Habjan <hab.nejc@gmail.com>2021-10-11 22:49:46 +0200
commit545f8ed24124837bf4e55aa34e185270a4b7aeff (patch)
treeadad76b598b917d9ca77ed600dcd62c63af67950 /tests/functional/api
parent5a1678f43184bd459132102cc13cf8426fe0449d (diff)
downloadgitlab-chore/master-to-main.tar.gz
chore: rename `master` branch to `main`chore/master-to-main
BREAKING CHANGE: As of python-gitlab 3.0.0, the default branch for development has changed from `master` to `main`.
Diffstat (limited to 'tests/functional/api')
-rw-r--r--tests/functional/api/test_merge_requests.py6
-rw-r--r--tests/functional/api/test_projects.py2
-rw-r--r--tests/functional/api/test_repository.py22
3 files changed, 15 insertions, 15 deletions
diff --git a/tests/functional/api/test_merge_requests.py b/tests/functional/api/test_merge_requests.py
index b20b66a..a814572 100644
--- a/tests/functional/api/test_merge_requests.py
+++ b/tests/functional/api/test_merge_requests.py
@@ -10,14 +10,14 @@ def test_merge_requests(project):
project.files.create(
{
"file_path": "README.rst",
- "branch": "master",
+ "branch": "main",
"content": "Initial content",
"commit_message": "Initial commit",
}
)
source_branch = "branch1"
- project.branches.create({"branch": source_branch, "ref": "master"})
+ project.branches.create({"branch": source_branch, "ref": "main"})
project.files.create(
{
@@ -28,7 +28,7 @@ def test_merge_requests(project):
}
)
project.mergerequests.create(
- {"source_branch": "branch1", "target_branch": "master", "title": "MR readme2"}
+ {"source_branch": "branch1", "target_branch": "main", "title": "MR readme2"}
)
diff --git a/tests/functional/api/test_projects.py b/tests/functional/api/test_projects.py
index 88b274c..ba8e25b 100644
--- a/tests/functional/api/test_projects.py
+++ b/tests/functional/api/test_projects.py
@@ -240,7 +240,7 @@ def test_project_stars(project):
def test_project_tags(project, project_file):
- tag = project.tags.create({"tag_name": "v1.0", "ref": "master"})
+ tag = project.tags.create({"tag_name": "v1.0", "ref": "main"})
assert len(project.tags.list()) == 1
tag.delete()
diff --git a/tests/functional/api/test_repository.py b/tests/functional/api/test_repository.py
index 7ba84ea..fe43862 100644
--- a/tests/functional/api/test_repository.py
+++ b/tests/functional/api/test_repository.py
@@ -10,32 +10,32 @@ def test_repository_files(project):
project.files.create(
{
"file_path": "README",
- "branch": "master",
+ "branch": "main",
"content": "Initial content",
"commit_message": "Initial commit",
}
)
- readme = project.files.get(file_path="README", ref="master")
+ readme = project.files.get(file_path="README", ref="main")
readme.content = base64.b64encode(b"Improved README").decode()
time.sleep(2)
- readme.save(branch="master", commit_message="new commit")
- readme.delete(commit_message="Removing README", branch="master")
+ readme.save(branch="main", commit_message="new commit")
+ readme.delete(commit_message="Removing README", branch="main")
project.files.create(
{
"file_path": "README.rst",
- "branch": "master",
+ "branch": "main",
"content": "Initial content",
"commit_message": "New commit",
}
)
- readme = project.files.get(file_path="README.rst", ref="master")
+ readme = project.files.get(file_path="README.rst", ref="main")
# The first decode() is the ProjectFile method, the second one is the bytes
# object method
assert readme.decode().decode() == "Initial content"
- blame = project.files.blame(file_path="README.rst", ref="master")
+ blame = project.files.blame(file_path="README.rst", ref="main")
assert blame
@@ -51,7 +51,7 @@ def test_repository_tree(project):
archive = project.repository_archive()
assert isinstance(archive, bytes)
- archive2 = project.repository_archive("master")
+ archive2 = project.repository_archive("main")
assert archive == archive2
snapshot = project.snapshot()
@@ -60,7 +60,7 @@ def test_repository_tree(project):
def test_create_commit(project):
data = {
- "branch": "master",
+ "branch": "main",
"commit_message": "blah blah blah",
"actions": [{"action": "create", "file_path": "blah", "content": "blah"}],
}
@@ -114,7 +114,7 @@ def test_commit_discussion(project):
def test_revert_commit(project):
commit = project.commits.list()[0]
- revert_commit = commit.revert(branch="master")
+ revert_commit = commit.revert(branch="main")
expected_message = 'Revert "{}"\n\nThis reverts commit {}'.format(
commit.message, commit.id
@@ -123,4 +123,4 @@ def test_revert_commit(project):
with pytest.raises(gitlab.GitlabRevertError):
# Two revert attempts should raise GitlabRevertError
- commit.revert(branch="master")
+ commit.revert(branch="main")