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