code: def test_forecast_with_multivariate_ts():
      forecast_length = 2
  
      historical_data, target = get_multimodal_ts_data()
  
      model = Fedot(
          problem="ts_forecasting",
          **TESTS_MAIN_API_DEFAULT_PARAMS,
          task_params=TsForecastingParams(
              forecast_length=forecast_length
          ),
      )
      model.fit(
          features=historical_data,
          target=target,
          predefined_model="auto",
      )
      forecast = model.forecast()
      assert len(forecast) == forecast_length
      forecast = model.forecast(horizon=forecast_length - 1)
      assert len(forecast) == forecast_length - 1
      with pytest.raises(ValueError):
          model.forecast(horizon=forecast_length + 1)
  
file_path: FEDOT/test/unit/api/test_main_api.py
imports: import numpy
  import pandas
  import pytest
  from fedot import Fedot
  from fedot.api.api_utils.api_data import ApiDataProcessor
  from fedot.core.data.data import InputData
  from fedot.core.data.multi_modal import MultiModalData
  from fedot.core.repository.tasks import Task, TaskTypesEnum, TsForecastingParams
  from fedot.core.utils import fedot_project_root
  from test.data.datasets import data_with_binary_features_and_categorical_target, get_dataset, load_categorical_multidata, get_split_data_paths, get_split_data, get_multimodal_ts_data, load_categorical_unimodal
label_desc: Use image node_id 7 for calling a global function with example usage: test_forecast_with_multivariate_ts() without return types