test_repo_commands.py 文件源码

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

项目:zazu 作者: stopthatcow 项目源码 文件源码
def test_clone_error(mocker, git_repo):
    mocker.patch('git.Repo.clone_from', side_effect=git.GitCommandError('clone', 'Foo'))
    dir = git_repo.working_tree_dir
    with zazu.util.cd(dir):
        runner = click.testing.CliRunner()
        result = runner.invoke(zazu.cli.cli, ['repo', 'clone', 'http://foo/bar/baz.git'])
        assert result.exit_code != 0
        assert result.exception
    git.Repo.clone_from.assert_called_once()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号