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


Python Review.publish_summary方法代码示例

本文整理汇总了Python中lintreview.review.Review.publish_summary方法的典型用法代码示例。如果您正苦于以下问题:Python Review.publish_summary方法的具体用法?Python Review.publish_summary怎么用?Python Review.publish_summary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lintreview.review.Review的用法示例。


在下文中一共展示了Review.publish_summary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_publish_summary

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_summary [as 别名]
    def test_publish_summary(self):
        gh = Mock()
        problems = Problems()

        filename_1 = 'Console/Command/Task/AssetBuildTask.php'
        errors = (
            (filename_1, 117, 'Something bad'),
            (filename_1, 119, 'Something bad'),
        )
        problems.add_many(errors)
        problems.set_changes([1])
        sha = 'abc123'

        review = Review(gh, 3)
        review.publish_summary(problems)

        assert gh.issues.comments.create.called
        eq_(1, gh.issues.comments.create.call_count)
        calls = gh.issues.comments.create.call_args_list

        msg = """There are 2 errors:

* Console/Command/Task/AssetBuildTask.php, line 117 - Something bad
* Console/Command/Task/AssetBuildTask.php, line 119 - Something bad
"""
        expected = call(3, msg)
        eq_(calls[0], expected)
开发者ID:hutchic,项目名称:lint-review,代码行数:29,代码来源:test_review.py

示例2: test_publish_summary

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_summary [as 别名]
    def test_publish_summary(self):
        problems = Problems()

        filename_1 = 'Console/Command/Task/AssetBuildTask.php'
        errors = (
            IssueComment('Terrible things'),
            Comment(filename_1, 117, 117, 'Something bad'),
            Comment(filename_1, 119, 119, 'Something bad'),
        )
        problems.add_many(errors)
        problems.set_changes([1])

        review = Review(self.repo, self.pr, self.config)
        review.publish_summary(problems)

        assert self.pr.create_comment.called
        self.assertEqual(1, self.pr.create_comment.call_count)

        msg = """There are 3 errors:

* Terrible things
* Console/Command/Task/AssetBuildTask.php, line 117 - Something bad
* Console/Command/Task/AssetBuildTask.php, line 119 - Something bad
"""
        self.pr.create_comment.assert_called_with(msg)
开发者ID:markstory,项目名称:lint-review,代码行数:27,代码来源:test_review.py

示例3: test_publish_summary

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_summary [as 别名]
    def test_publish_summary(self):
        problems = Problems()

        filename_1 = 'Console/Command/Task/AssetBuildTask.php'
        errors = (
            (filename_1, 117, 'Something bad'),
            (filename_1, 119, 'Something bad'),
        )
        problems.add_many(errors)
        problems.set_changes([1])

        review = Review(self.gh, 3)
        review.publish_summary(problems)

        assert self.issue.create_comment.called
        eq_(1, self.issue.create_comment.call_count)

        msg = """There are 2 errors:

* Console/Command/Task/AssetBuildTask.php, line 117 - Something bad
* Console/Command/Task/AssetBuildTask.php, line 119 - Something bad
"""
        self.issue.create_comment.assert_called_with(msg)
开发者ID:pSub,项目名称:lint-review,代码行数:25,代码来源:test_review.py

示例4: test_publish_comment_threshold_checks

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_summary [as 别名]
    def test_publish_comment_threshold_checks(self):
        fixture = load_fixture('comments_current.json')
        self.pr.review_comments.return_value = [GhIssueComment(f) for f in json.loads(fixture)]

        problems = Problems()

        filename_1 = 'Console/Command/Task/AssetBuildTask.php'
        errors = (
            (filename_1, 117, 'Something bad'),
            (filename_1, 119, 'Something bad'),
        )
        problems.add_many(errors)
        problems.set_changes([1])
        sha = 'abc123'

        review = Review(self.gh, 3)
        review.publish_summary = Mock()
        review.publish(problems, sha, 1)

        assert review.publish_summary.called, 'Should have been called.'
开发者ID:coras-io,项目名称:lint-review,代码行数:22,代码来源:test_review.py

示例5: test_publish_comment_threshold_checks

# 需要导入模块: from lintreview.review import Review [as 别名]
# 或者: from lintreview.review.Review import publish_summary [as 别名]
    def test_publish_comment_threshold_checks(self, http):
        fixture_data = load_fixture('comments_current.json')
        response = Response()
        response._content = fixture_data
        http.return_value = response

        gh = Github()
        problems = Problems()

        filename_1 = 'Console/Command/Task/AssetBuildTask.php'
        errors = (
            (filename_1, 117, 'Something bad'),
            (filename_1, 119, 'Something bad'),
        )
        problems.add_many(errors)
        problems.set_changes([1])
        sha = 'abc123'

        review = Review(gh, 3)
        review.publish_summary = Mock()
        review.publish(problems, sha, 1)

        assert review.publish_summary.called, 'Should have been called.'
开发者ID:hutchic,项目名称:lint-review,代码行数:25,代码来源:test_review.py


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