本文整理汇总了Python中qisrc.test.conftest.TestGit.fetch方法的典型用法代码示例。如果您正苦于以下问题:Python TestGit.fetch方法的具体用法?Python TestGit.fetch怎么用?Python TestGit.fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qisrc.test.conftest.TestGit
的用法示例。
在下文中一共展示了TestGit.fetch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_using_carbon_copy
# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import fetch [as 别名]
def test_using_carbon_copy(qisrc_action, git_server):
foo_repo = git_server.create_repo("foo.git", review=True)
qisrc_action("init", git_server.manifest_url)
git_worktree = TestGitWorkTree()
foo_proj = git_worktree.get_git_project("foo")
foo_git = TestGit(foo_proj.path)
# Need to fetch gerrit remote at least once for gerrit/master to exist
foo_git.fetch("--all")
foo_git.commit_file("a.txt", "a")
with mock.patch.object(qisys.command, "call") as mocked_call:
qisrc_action("push", "foo", "--cc", "jdoe")
set_reviewers_args = mocked_call.call_args_list[2][0][0][7]
assert "jdoe" in set_reviewers_args
示例2: test_happy_rebase
# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import fetch [as 别名]
def test_happy_rebase(git_server, qisrc_action):
git_server.create_repo("foo")
git_server.switch_manifest_branch("devel")
git_server.change_branch("foo", "devel")
qisrc_action("init", git_server.manifest_url, "--branch", "devel")
git_server.push_file("foo", "master.txt", "master")
git_worktree = TestGitWorkTree()
foo_proj = git_worktree.get_git_project("foo")
git = TestGit(foo_proj.path)
git.commit_file("devel.txt", "devel")
git.push()
git.fetch()
qisrc_action("rebase", "--branch", "master", "--all")
rc, out = git.log("--pretty=oneline", raises=False)
assert len(out.splitlines()) == 3
示例3: test_push_after_rebase
# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import fetch [as 别名]
def test_push_after_rebase(git_server, git_worktree, qisrc_action, interact):
git_server.create_repo("foo")
git_server.switch_manifest_branch("devel")
git_server.change_branch("foo", "devel")
git_server.push_file("foo", "master.txt", "devel")
qisrc_action("init", git_server.manifest_url, "--branch", "devel")
git_server.push_file("foo", "master.txt", "master")
git_worktree = TestGitWorkTree()
foo_proj = git_worktree.get_git_project("foo")
git = TestGit(foo_proj.path)
git.commit_file("devel.txt", "devel")
git.fetch()
git.push("origin", "devel")
interact.answers = [True]
qisrc_action("rebase", "--branch", "master", "--push", "--force", "--all")
local_sha1 = git.get_ref_sha1("refs/heads/devel")
remote_sha1 = git.get_ref_sha1("refs/remotes/origin/devel")
assert local_sha1 == remote_sha1
示例4: test_alert_maintainers
# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import fetch [as 别名]
def test_alert_maintainers(qisrc_action, git_server):
foo_repo = git_server.create_repo("foo.git", review=True)
qiproject_xml = """\
<project version="3">
<maintainer email="[email protected]">John Doe</maintainer>
</project>"""
git_server.push_file("foo.git", "qiproject.xml", qiproject_xml)
qisrc_action("init", git_server.manifest_url)
git_worktree = TestGitWorkTree()
foo_proj = git_worktree.get_git_project("foo")
foo_git = TestGit(foo_proj.path)
# Need to fetch gerrit remote at least once for gerrit/master to exist
foo_git.fetch("--all")
foo_git.commit_file("a.txt", "a")
with mock.patch.object(qisys.command, "call") as mocked_call:
qisrc_action("push", "foo")
set_reviewers_args = mocked_call.call_args_list[3][0][0][7]
assert "[email protected]" in set_reviewers_args
示例5: test_rebase_conflict
# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import fetch [as 别名]
def test_rebase_conflict(git_server, qisrc_action):
git_server.create_repo("foo")
git_server.switch_manifest_branch("devel")
git_server.change_branch("foo", "devel")
qisrc_action("init", git_server.manifest_url, "--branch", "devel")
git_server.push_file("foo", "foo.txt", "master")
git_worktree = TestGitWorkTree()
foo_proj = git_worktree.get_git_project("foo")
git = TestGit(foo_proj.path)
git.commit_file("foo.txt", "devel")
git.push()
_, before = git.call("show", raises=False)
git.fetch()
# pylint: disable-msg=E1101
with pytest.raises(Exception):
qisrc_action("rebase", "--branch", "master", "--all")
_, after = git.call("show", raises=False)
assert after == before