test_osa_differ.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:osa_differ 作者: major 项目源码 文件源码
def test_repo_update_with_fetch(self, tmpdir, monkeypatch):
        """Verify that we can get a repo ready and update it."""
        p = tmpdir.mkdir('test')
        path = str(p)
        repo = Repo.init(path)
        file = p / 'test.txt'
        file.write_text(u'Testing', encoding='utf-8')
        repo.index.add(['test.txt'])
        repo.index.commit('Testing')
        repo.create_remote('origin', url='http://example.com')

        monkeypatch.setattr(
            "git.cmd.Git._call_process", lambda *args, **kwargs: True)
        result = osa_differ.repo_pull(path,
                                      "http://example.com",
                                      fetch=True)
        monkeypatch.undo()
        assert result.active_branch.name == 'master'
        assert not result.is_dirty()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号