Пример #1
0
    def test_publish(self):
        pull = self.get_pull_request()
        repo = Mock()

        subject = Processor(repo, pull, './tests', app_config)
        subject.problems = Mock()
        subject._review = Mock()

        subject.publish()
        eq_(True, subject.problems.limit_to_changes.called,
            'Problems should be filtered.')
        eq_(True, subject._review.publish.called,
            'Review should be published.')
        subject._review.publish.assert_called_with(subject.problems, pull.head,
                                                   50)
Пример #2
0
    def test_publish_checkrun(self):
        pull = self.get_pull_request()
        repo = Mock()

        config = build_review_config(fixer_ini, app_config)
        subject = Processor(repo, pull, './tests', config)
        subject.problems = Mock()
        subject._review = Mock()

        subject.publish(check_run_id=9)
        eq_(True, subject.problems.limit_to_changes.called,
            'Problems should be filtered.')
        eq_(True, subject._review.publish_checkrun.called,
            'Review should be published.')
        subject._review.publish_checkrun.assert_called_with(
            subject.problems, 9)
Пример #3
0
    def test_publish(self):
        pull = self.get_pull_request()
        repo = Mock()

        config = build_review_config(fixer_ini, app_config)
        subject = Processor(repo, pull, './tests', config)
        subject.problems = Mock()
        subject._review = Mock()

        subject.publish()
        self.assertTrue(subject.problems.limit_to_changes.called,
                        'Problems should be filtered.')
        self.assertTrue(subject._review.publish_review.called,
                        'Review should be published.')
        subject._review.publish_review.assert_called_with(
            subject.problems,
            pull.head)