def compare(self, old, changes, expected_changes):

        # Clear and update the original dicts so they can be referenced
        # in the structures passed as arguments.
        for msg in self.old_msg, self.new_msg, self.expected_msg:
            msg.clear()

        self.old_msg.update(old)
        self.new_msg.update(merge_dicts(old, changes))
        if expected_changes is not None:
            self.expected_msg.update(
                merge_dicts(self.new_msg, expected_changes))

        if ('signing_severity' in self.expected_msg and
                'ignore_duplicates' not in self.expected_msg):
            # The annotator should add an ignore_duplicates key to all
            # signing-related messages that don't have one.
            if utils.ValidationComparator.message_key(self.expected_msg):
                self.expected_msg['ignore_duplicates'] = (
                    utils.ValidationComparator.is_ignorable(self.expected_msg))

        results = self.run_comparator(self.old_msg, self.new_msg.copy())

        if expected_changes is not None:
            assert results['messages'] == [self.expected_msg]

        if 'signing_severity' in self.new_msg:
            summary = merge_dicts(self.SIGNING_SUMMARY,
                                  {self.new_msg['signing_severity']: 1})

            summaries = (results['signing_summary'],
                         results['signing_ignored_summary'])

            # If the message is ignored, we should see it counted only in the
            # ignored message summary, otherwise we should expect to see it
            # counted only in the main summary.
            if self.expected_msg.get('ignored'):
                assert summaries == (self.SIGNING_SUMMARY, summary)
            else:
                assert summaries == (summary, self.SIGNING_SUMMARY)

        return results
Compare two messages, and assert that the expected annotations are
dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_utils.py/TestValidationComparator.compare