def test_download_and_preprocess_media_preprocessor_called(self):
        """
        Ensure that the image preprocessor is called during image preprocessing.
        """
        image_preprocessor = MagicMock(spec=MultilingualCLIPPreprocessor)
        image_preprocessor._preprocess_image.return_value = torch.tensor([1.0])

        model = MagicMock(spec=MultilingualCLIPModel)
        model.get_preprocessor.return_value = image_preprocessor

        inference_request = InferenceRequest(
            modality=Modality.IMAGE,
            contents=["http://some.image/url.jpg"],
            preprocessing_config=ImagePreprocessingConfig(),
            return_individual_error=False,
            model_config=MagicMock(spec=ModelConfig)
        )

        pipeline = MultilingualCLIPModelInferencePipeline(model, inference_request)

        with patch(
                "marqo.inference.native_inference.inference_pipeline.multilingual_inference_pipeline."
                "download_and_preprocess_media"
        ) as mock_download:
            mock_download.side_effect = lambda contents, preprocessor, config, return_individual_error: [
                [(contents[0], preprocessor._preprocess_image(contents[0]))]]
            result = pipeline._content_preprocessing()

        image_preprocessor._preprocess_image.assert_called_once_with("http://some.image/url.jpg")
        self.assertTrue(torch.equal(result[0][0][1], torch.tensor([1.0])))

        Ensure that the image preprocessor is called during image preprocessing.
        
tests/unit_tests/marqo/inference/native_inference/test_multiling_clip_inference_pipeline.py