本文整理汇总了Python中lintreview.review.Review.publish_pull_review方法的典型用法代码示例。如果您正苦于以下问题:Python Review.publish_pull_review方法的具体用法?Python Review.publish_pull_review怎么用?Python Review.publish_pull_review使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lintreview.review.Review
的用法示例。
在下文中一共展示了Review.publish_pull_review方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_publish_pull_review_remove_ok_label
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_pull_review [as 别名]
def test_publish_pull_review_remove_ok_label(self):
problems = Problems()
filename_1 = 'Console/Command/Task/AssetBuildTask.php'
errors = (
Comment(filename_1, 117, 117, 'Something bad'),
Comment(filename_1, 119, 119, 'Something bad'),
)
problems.add_many(errors)
tst_config = build_review_config(fixer_ini, {'OK_LABEL': 'No lint'})
review = Review(self.repo, self.pr, tst_config)
sha = 'abc123'
review.publish_pull_review(problems, sha)
assert self.pr.remove_label.called, 'Label should be removed'
assert self.pr.create_review.called, 'Review should be added'
self.assertEqual(1, self.pr.create_review.call_count)
self.pr.remove_label.assert_called_with(tst_config['OK_LABEL'])
assert_review(
self,
self.pr.create_review.call_args,
errors,
sha)
示例2: test_publish_pull_review__no_comments
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_pull_review [as 别名]
def test_publish_pull_review__no_comments(self):
problems = Problems()
sha = 'abc123'
review = Review(self.repo, self.pr, self.config)
review.publish_pull_review(problems, sha)
assert self.pr.create_review.called is False
示例3: test_publish_pull_review__only_issue_comment
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_pull_review [as 别名]
def test_publish_pull_review__only_issue_comment(self):
problems = Problems()
problems.add(IssueComment('Very bad'))
sha = 'abc123'
review = Review(self.repo, self.pr, self.config)
review.publish_pull_review(problems, sha)
assert self.pr.create_review.called
assert_review(
self,
self.pr.create_review.call_args,
[],
sha,
body='Very bad')
示例4: test_publish_pull_review
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_pull_review [as 别名]
def test_publish_pull_review(self):
problems = Problems()
filename_1 = 'Console/Command/Task/AssetBuildTask.php'
errors = (
Comment(filename_1, 117, 117, 'Something bad'),
Comment(filename_1, 119, 119, 'Something bad'),
)
problems.add_many(errors)
sha = 'abc123'
review = Review(self.repo, self.pr, self.config)
review.publish_pull_review(problems, sha)
assert self.pr.create_review.called
self.assertEqual(1, self.pr.create_review.call_count)
assert_review(
self,
self.pr.create_review.call_args,
errors,
sha)
示例5: test_publish__join_issue_comments
# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_pull_review [as 别名]
def test_publish__join_issue_comments(self):
problems = Problems()
filename_1 = 'Console/Command/Task/AssetBuildTask.php'
errors = (
IssueComment('First'),
Comment(filename_1, 119, 119, 'Something bad'),
IssueComment('Second'),
)
problems.add_many(errors)
sha = 'abc123'
review = Review(self.repo, self.pr, self.config)
review.publish_pull_review(problems, sha)
assert self.pr.create_review.called
self.assertEqual(1, self.pr.create_review.call_count)
assert_review(
self,
self.pr.create_review.call_args,
[errors[1]],
sha,
body='First\n\nSecond')