本文整理汇总了Python中lintreview.review.Review.publish_status方法的典型用法代码示例。如果您正苦于以下问题:Python Review.publish_status方法的具体用法?Python Review.publish_status怎么用?Python Review.publish_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lintreview.review.Review
的用法示例。
在下文中一共展示了Review.publish_status方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_publish_status__ok_no_comment_or_label
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__ok_no_comment_or_label(self):
config = {'OK_COMMENT': None, 'OK_LABEL': None}
review = Review(self.gh, 3, config)
review.publish_status(0)
assert self.gh.create_status.called, 'Create status not called'
assert not self.issue.create_comment.called, 'Comment not created'
assert not self.issue.add_labels.called, 'Label added created'
示例2: test_publish_status__ok_no_comment_label_or_status
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__ok_no_comment_label_or_status(self):
config = {
'OK_COMMENT': None,
'OK_LABEL': None,
'PULLREQUEST_STATUS': False,
}
review = Review(self.repo, self.pr, config)
review.publish_status(0)
assert not self.repo.create_status.called, 'Create status called'
assert not self.pr.create_comment.called, 'Comment not created'
assert not self.pr.add_label.called, 'Label added created'
示例3: test_publish_status__ok_no_comment_or_label
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__ok_no_comment_or_label(self):
app_config = {
'OK_COMMENT': None,
'OK_LABEL': None,
'PULLREQUEST_STATUS': False,
}
tst_config = build_review_config(fixer_ini, app_config)
review = Review(self.repo, self.pr, tst_config)
review.publish_status(False)
assert self.repo.create_status.called, 'Create status called'
assert not self.pr.create_comment.called, 'Comment not created'
assert not self.pr.add_label.called, 'Label added created'
示例4: test_publish_status__ok_with_comment_and_label
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__ok_with_comment_and_label(self):
config = {'OK_COMMENT': 'Great job!', 'OK_LABEL': 'No lint errors'}
review = Review(self.repo, self.pr, config)
review.publish_status(0)
assert self.repo.create_status.called, 'Create status not called'
self.repo.create_status.assert_called_with(
self.pr.head,
'success',
'No lint errors found.')
assert self.pr.create_comment.called, 'Issue comment created'
self.pr.create_comment.assert_called_with('Great job!')
assert self.pr.add_label.called, 'Label added created'
self.pr.add_label.assert_called_with('No lint errors')
示例5: test_publish_status__has_errors
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__has_errors(self):
config = {
'OK_COMMENT': 'Great job!',
'OK_LABEL': 'No lint errors',
'APP_NAME': 'custom-name'
}
review = Review(self.repo, self.pr, config)
review.publish_status(1)
assert self.repo.create_status.called, 'Create status not called'
self.repo.create_status.assert_called_with(
self.pr.head,
'failure',
'Lint errors found, see pull request comments.')
assert not self.pr.create_comment.called, 'Comment not created'
assert not self.pr.add_label.called, 'Label added created'
示例6: test_publish_status__has_errors__success_status
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__has_errors__success_status(self):
app_config = {
'PULLREQUEST_STATUS': False,
'OK_COMMENT': 'Great job!',
'OK_LABEL': 'No lint errors',
'APP_NAME': 'custom-name'
}
tst_config = build_review_config(fixer_ini, app_config)
self.assertEqual('success', tst_config.failed_review_status(),
'config object changed')
review = Review(self.repo, self.pr, tst_config)
review.publish_status(True)
assert self.repo.create_status.called, 'Create status not called'
self.repo.create_status.assert_called_with(
self.pr.head,
'success',
'Lint errors found, see pull request comments.')
assert not self.pr.create_comment.called, 'Comment not created'
assert not self.pr.add_label.called, 'Label added created'
示例7: test_publish_status__ok_with_comment_label
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_status [as 别名]
def test_publish_status__ok_with_comment_label(self):
app_config = {
'OK_COMMENT': 'Great job!',
'OK_LABEL': 'No lint errors',
'PULLREQUEST_STATUS': True,
}
tst_config = build_review_config(fixer_ini, app_config)
Review(self.repo, self.pr, tst_config)
review = Review(self.repo, self.pr, tst_config)
review.publish_status(False)
assert self.repo.create_status.called, 'Create status not called'
self.repo.create_status.assert_called_with(
self.pr.head,
'success',
'No lint errors found.')
assert self.pr.create_comment.called, 'Issue comment created'
self.pr.create_comment.assert_called_with('Great job!')
assert self.pr.add_label.called, 'Label added created'
self.pr.add_label.assert_called_with('No lint errors')