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


Python Repository.get_unstaged_files方法代码示例

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


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

示例1: test_reset_default

# 需要导入模块: from repository import Repository [as 别名]
# 或者: from repository.Repository import get_unstaged_files [as 别名]
 def test_reset_default(self):
     Command.cmd_reset(self.first_commit, is_soft=False, is_hard=False)
     self.assertEqual(Branch().head_commit, self.first_commit)
     repo = Repository()
     uncommitted_files = repo.get_uncommitted_files()
     unstaged_files = repo.get_unstaged_files()
     self.assertFalse(uncommitted_files['modified'])
     self.assertIn(self.path, unstaged_files['modified'])
开发者ID:Oloshka,项目名称:git-in-python,代码行数:10,代码来源:test_reset.py

示例2: test_status_unstaged_files

# 需要导入模块: from repository import Repository [as 别名]
# 或者: from repository.Repository import get_unstaged_files [as 别名]
 def test_status_unstaged_files(self):
     file_list = [('1.txt', '1\n'), ('2.txt', '2\n')]
     for path, content in file_list:
         write_to_file(path, content)
         Command.cmd_add(path)
     
     write_to_file(file_list[0][0], '11\n')
     os.remove(file_list[1][0])
     
     repo = Repository()
     unstaged_files = repo.get_unstaged_files()
     
     self.assertEqual(unstaged_files['modified'], [file_list[0][0]])
     self.assertEqual(unstaged_files['deleted'], [file_list[1][0]])
     Command.cmd_status()
开发者ID:Oloshka,项目名称:git-in-python,代码行数:17,代码来源:test_status.py


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