def test_infer_modality_receive_bytes_code_path(self):
        """A test to ensure if bytes is received, we skip extension and mime download, but mime check on the bytes."""
        bytes = b"test"

        with patch('marqo.core.inference.modality_utils._infer_modality_based_on_extension') as mock_infer_on_extension, \
                patch('marqo.core.inference.modality_utils.fetch_content_sample') as mock_fetch, \
                patch('marqo.core.inference.modality_utils.magic.from_buffer', return_value="image/jpeg") as mock_magic, \
                patch('marqo.core.inference.modality_utils._infer_modality_based_on_mime_type') as mock_infer_on_mime:

            _ = infer_modality(bytes)
            mock_infer_on_extension.assert_not_called()
            mock_fetch.assert_not_called()
            mock_magic.assert_called_once_with(bytes, mime=True)
            mock_infer_on_mime.assert_called_once_with("image/jpeg")
A test to ensure if bytes is received, we skip extension and mime download, but mime check on the bytes.
tests/unit_tests/marqo/core/inference/test_infer_modality.py