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=np.arange(10),
          index=pd.date_range(start="2022-01-01", periods=10),
      )
      forecaster = ForecasterAutoregDirect(
          LinearRegression(), lags=3, steps=2
      )
      forecaster.fit(y=serie_with_DatetimeIndex)
      expected = serie_with_DatetimeIndex.index.freqstr
      results = forecaster.index_freq
  
      assert results == expected
  
file_path: skforecast/skforecast/ForecasterAutoregDirect/tests/test_fit.py
imports: import re
  import pytest
  import numpy
  import pandas
  from skforecast.ForecasterAutoregDirect import ForecasterAutoregDirect
  from sklearn.linear_model import LinearRegression
label_desc: Use image node_id 1 for calling a global function with example usage: test_forecaster_DatetimeIndex_index_freq_stored() without return types