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()
评论列表
文章目录