code: def test_forecaster_DatetimeIndex_index_freq_stored():
      """
      Test serie_with_DatetimeIndex.index.freqstr is stored in forecaster.index_freq.
      """
      serie_with_DatetimeIndex = pd.Series(
          data=[1, 2, 3, 4, 5],
          index=pd.date_range(start="2022-01-01", periods=5),
      )
      forecaster = ForecasterSarimax(regressor=Sarimax(order=(1, 0, 0)))
      forecaster.fit(y=serie_with_DatetimeIndex)
      expected = serie_with_DatetimeIndex.index.freqstr
      results = forecaster.index_freq
  
      assert results == expected
  
file_path: skforecast/skforecast/ForecasterSarimax/tests/test_fit.py
imports: import re
  import pytest
  import numpy
  import pandas
  from pmdarima.arima import ARIMA
  from skforecast.Sarimax import Sarimax
  from skforecast.ForecasterSarimax import ForecasterSarimax
  from .fixtures_ForecasterSarimax import y
  from .fixtures_ForecasterSarimax import y_datetime
label_desc: Use image node_id 2 for calling a global function with example usage: test_forecaster_DatetimeIndex_index_freq_stored() without return types