summaryrefslogtreecommitdiff
path: root/tests/functional
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
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')
-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
-rw-r--r--tests/functional/cli/test_cli_artifacts.py2
-rw-r--r--tests/functional/cli/test_cli_v4.py8
-rw-r--r--tests/functional/conftest.py2
6 files changed, 21 insertions, 21 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")
diff --git a/tests/functional/cli/test_cli_artifacts.py b/tests/functional/cli/test_cli_artifacts.py
index aab0546..76eb9f2 100644
--- a/tests/functional/cli/test_cli_artifacts.py
+++ b/tests/functional/cli/test_cli_artifacts.py
@@ -14,7 +14,7 @@ content = textwrap.dedent(
)
data = {
"file_path": ".gitlab-ci.yml",
- "branch": "master",
+ "branch": "main",
"content": content,
"commit_message": "Initial commit",
}
diff --git a/tests/functional/cli/test_cli_v4.py b/tests/functional/cli/test_cli_v4.py
index a63c1b1..91c0afa 100644
--- a/tests/functional/cli/test_cli_v4.py
+++ b/tests/functional/cli/test_cli_v4.py
@@ -125,7 +125,7 @@ def test_list_user_memberships(gitlab_cli, user):
def test_project_create_file(gitlab_cli, project):
file_path = "README"
- branch = "master"
+ branch = "main"
content = "CONTENT"
commit_message = "Initial commit"
@@ -197,7 +197,7 @@ def test_create_branch(gitlab_cli, project):
"--branch",
branch,
"--ref",
- "master",
+ "main",
]
ret = gitlab_cli(cmd)
@@ -215,7 +215,7 @@ def test_create_merge_request(gitlab_cli, project):
"--source-branch",
branch,
"--target-branch",
- "master",
+ "main",
"--title",
"Update README",
]
@@ -260,7 +260,7 @@ def test_revert_commit(gitlab_cli, project):
"--id",
commit.id,
"--branch",
- "master",
+ "main",
]
ret = gitlab_cli(cmd)
diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py
index 23aa583..b6fb9ed 100644
--- a/tests/functional/conftest.py
+++ b/tests/functional/conftest.py
@@ -305,7 +305,7 @@ def project_file(project):
project_file = project.files.create(
{
"file_path": "README",
- "branch": "master",
+ "branch": "main",
"content": "Initial content",
"commit_message": "Initial commit",
}