本文整理汇总了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)