def check_file(self, file_new, file_old):

        # Create an annotator, make sure it matches the expected older file.
        va = utils.ValidationAnnotator(file_new)
        assert va.prev_file == file_old

        # We shouldn't be attempting to validate a bare upload.
        assert not self.validate_upload.called

        # Make sure we run the correct validation tasks for both files,
        # or only one validation task if there's no match.
        if file_old:
            self.validate_file.assert_has_calls([
                mock.call([file_new.pk], {
                    'hash_': file_new.original_hash,
                    'is_webextension': False}),
                mock.call([file_old.pk], {
                    'hash_': file_old.original_hash,
                    'is_webextension': False})
            ])
        else:
            self.validate_file.assert_called_once_with(
                [file_new.pk],
                {'hash_': file_new.original_hash, 'is_webextension': False})

        # Make sure we run the correct save validation task, with a
        # fallback error handler.
        self.save_file.assert_has_calls([
            mock.call([mock.ANY, file_new.pk], {'annotate': False},
                      immutable=True),
            mock.call([file_new.pk], link_error=mock.ANY)])
Check that the given new file is matched to the given old file.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_utils.py/TestValidationAnnotatorBase.check_file