def test__when_setting_pr_sync_label__if_github_returns_proper_objects__pr_sync_label_should_be_set(self):
github_client: github.Github = mock(spec=github.Github, strict=True)
github_controller = GithubController(github_client, mock(), mock(), mock())
github_repository: github.Repository.Repository = mock(spec=github.Repository.Repository, strict=True)
github_issue: github.Issue.Issue = mock(spec=github.Issue.Issue, strict=True)
# given
when(github_client).get_repo('repo')\
.thenReturn(github_repository)
when(github_repository).get_issue(43)\
.thenReturn(github_issue)
expect(github_issue, times=1)\
.add_to_labels('triggear-pr-sync')
# when
result = await github_controller.set_pr_sync_label_with_retry('repo', 43)
# then
assert result is None
评论列表
文章目录