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


Python TestGit.add方法代码示例

本文整理汇总了Python中qisrc.test.conftest.TestGit.add方法的典型用法代码示例。如果您正苦于以下问题:Python TestGit.add方法的具体用法?Python TestGit.add怎么用?Python TestGit.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qisrc.test.conftest.TestGit的用法示例。


在下文中一共展示了TestGit.add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_keeps_staged_changes

# 需要导入模块: from qisrc.test.conftest import TestGit [as 别名]
# 或者: from qisrc.test.conftest.TestGit import add [as 别名]
def test_keeps_staged_changes(qisrc_action, git_server):
    git_server.create_repo("foo.git")
    qisrc_action("init", git_server.manifest_url)
    qisrc_action("sync")
    git_worktree = TestGitWorkTree()
    foo = git_worktree.get_git_project("foo")
    test_git = TestGit(foo.path)
    staged_file = os.path.join(foo.path, "staged")
    with open(staged_file, "w") as f:
        f.write("I'm going to stage stuff")
    test_git.add(staged_file)
    foo.sync()
    assert os.path.exists(staged_file)
开发者ID:cameronyoyos,项目名称:qibuild,代码行数:15,代码来源:test_qisrc_sync.py


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