当前位置: 首页>>代码示例>>Python>>正文


Python Review.publish_pull_review方法代码示例

本文整理汇总了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)
开发者ID:markstory,项目名称:lint-review,代码行数:27,代码来源:test_review.py

示例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
开发者ID:markstory,项目名称:lint-review,代码行数:10,代码来源:test_review.py

示例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')
开发者ID:markstory,项目名称:lint-review,代码行数:17,代码来源:test_review.py

示例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)
开发者ID:markstory,项目名称:lint-review,代码行数:24,代码来源:test_review.py

示例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')
开发者ID:markstory,项目名称:lint-review,代码行数:26,代码来源:test_review.py


注:本文中的lintreview.review.Review.publish_pull_review方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。