def test_compare_results(self):
        """Test that `compare` tests results correctly."""

        with mock.patch.object(self, 'run_comparator') as comparator:
            MSG = {'id': (), 'context': (), 'file': 'file.js',
                   'signing_severity': 'low'}
            EXPECTED = {'matched': MSG, 'ignored': True}
            FINAL = merge_dicts(MSG, EXPECTED)

            comparator.return_value = {
                'messages': [FINAL],
                'signing_summary': {'low': 0, 'medium': 0, 'high': 0,
                                    'trivial': 0},
                'signing_ignored_summary': {'low': 1, 'medium': 0, 'high': 0,
                                            'trivial': 0}}

            # Signing summary with ignored messages:
            self.compare(MSG, {}, EXPECTED)

            comparator.return_value['signing_summary']['low'] = 1
            try:
                self.compare(MSG, {}, EXPECTED)
            except AssertionError:
                pass
            else:
                assert False, 'Bad signing summary passed.'

            comparator.return_value['signing_summary']['low'] = 0
            comparator.return_value['signing_ignored_summary']['low'] = 0
            try:
                self.compare(MSG, {}, EXPECTED)
            except AssertionError:
                pass
            else:
                assert False, 'Bad ignored signing summary passed.'

            # Signing summary without ignored messages:
            CHANGES = {'id': ('a', 'b', 'c')}
            FINAL = merge_dicts(MSG, CHANGES)

            comparator.return_value['messages'] = [FINAL]
            comparator.return_value['signing_summary']['low'] = 1

            self.compare(MSG, CHANGES, {})

            comparator.return_value['signing_summary']['low'] = 0
            try:
                self.compare(MSG, CHANGES, {})
            except __HOLE__:
                pass
            else:
                assert False, 'Bad signing summary passed.'

            comparator.return_value['signing_summary']['low'] = 1
            comparator.return_value['signing_ignored_summary']['low'] = 1
            try:
                self.compare(MSG, CHANGES, {})
            except AssertionError:
                pass
            else:
                assert False, 'Bad ignored signing summary passed.'
dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_utils.py/TestValidationComparator.test_compare_results