test_github_controller.py 文件源码

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

项目:triggear 作者: futuresimple 项目源码 文件源码
def test__get_latest_commit_sha__should_call_proper_github_entities(self):
        github_client: github.Github = mock(spec=github.Github, strict=True)
        github_repo: github.Repository.Repository = mock(spec=github.Repository.Repository, strict=True)
        github_head: github.PullRequestPart.PullRequestPart = mock({'sha': '123zxc'}, spec=github.PullRequestPart, strict=True)
        github_pull_request: github.PullRequest.PullRequest = mock({'head': github_head}, spec=github.PullRequest.PullRequest, strict=True)
        github_controller = GithubController(github_client, mock(), mock(), mock())

        expect(github_client).get_repo('triggear').thenReturn(github_repo)
        expect(github_repo).get_pull(32).thenReturn(github_pull_request)

        sha: str = github_controller.get_latest_commit_sha(32, 'triggear')

        assert '123zxc' == sha
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号