code: def test_fit_offset_DateOffset():
      """
      Test window_size and last_window are set correctly when offset is a DateOffset.
      """
      forecaster = ForecasterEquivalentDate(
          offset=DateOffset(days=2),
          n_offsets=2,
          agg_func=np.mean,
          forecaster_id=None,
      )
      y = pd.Series(
          np.random.rand(10),
          index=pd.date_range(start="01/01/2021", periods=10),
      )
      forecaster.fit(y)
  
      assert forecaster.window_size == 4.0
      assert forecaster.last_window.equals(y)
  
file_path: skforecast/skforecast/ForecasterBaseline/tests/test_fit.py
imports: import re
  import pytest
  import numpy
  import pandas
  from pandas.tseries.offsets import DateOffset
  from skforecast.ForecasterBaseline import ForecasterEquivalentDate
label_desc: Use image node_id 7 for calling a global function with example usage: test_fit_offset_DateOffset() without return types