当前位置: 首页>>代码示例>>Python>>正文


Python TestGit.fetch方法代码示例

本文整理汇总了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
开发者ID:Fantomatic,项目名称:qibuild,代码行数:15,代码来源:test_qisrc_push.py

示例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
开发者ID:Mhalla,项目名称:qibuild,代码行数:17,代码来源:test_qisrc_rebase.py

示例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
开发者ID:Mhalla,项目名称:qibuild,代码行数:20,代码来源:test_qisrc_rebase.py

示例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
开发者ID:Fantomatic,项目名称:qibuild,代码行数:20,代码来源:test_qisrc_push.py

示例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
开发者ID:cameronyoyos,项目名称:qibuild,代码行数:20,代码来源:test_qisrc_rebase.py


注:本文中的qisrc.test.conftest.TestGit.fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。