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


Python Review.publish_status方法代码示例

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

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

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

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

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

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

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


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