def check_upload(self, file_, listed=None):

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

        # Make sure we run the correct validation task for the matched file,
        # if there is a match.
        if file_:
            self.validate_file.assert_called_once_with(
                [file_.pk],
                {'hash_': file_.original_hash, 'is_webextension': False})
        else:
            assert not self.validate_file.called

        # Make sure we run the correct validation task for the upload.
        self.validate_upload.assert_called_once_with(
            [self.file_upload.path],
            {'hash_': self.file_upload.hash, 'listed': listed,
             'is_webextension': False})

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