code: def test_constant_mean_forecast(self):
      am = arch_model(self.zero_mean, mean="Constant", vol="Constant")
      res = am.fit()
      fcast = res.forecast(horizon=5)
  
      assert np.all(np.asarray(np.isnan(fcast.mean[:-1])))
      assert np.all(np.asarray(np.isnan(fcast.variance[:-1])))
      assert np.all(np.asarray(np.isnan(fcast.residual_variance[:-1])))
      params = np.asarray(res.params)
      assert_allclose(params[0] * np.ones(5), fcast.mean.iloc[-1])
      assert_allclose(params[1] * np.ones(5), fcast.variance.iloc[-1])
      assert_allclose(
          params[1] * np.ones(5), fcast.residual_variance.iloc[-1]
      )
  
      assert fcast.mean.shape == (1, 5)
      assert fcast.variance.shape == (1, 5)
      assert fcast.residual_variance.shape == (1, 5)
  
imports: import datetime
  from itertools import product
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose
  import pandas
  from pandas.testing import assert_frame_equal
  import pytest
  from arch.data import sp500
  from arch.tests.univariate.test_variance_forecasting import preserved_state
  from arch.univariate import APARCH, ARX, EGARCH, FIGARCH, GARCH, HARCH, HARX, ConstantMean, ConstantVariance, EWMAVariance, MIDASHyperbolic, RiskMetrics2006, ZeroMean, arch_model
  from arch.univariate.mean import _ar_forecast, _ar_to_impulse
label_desc: Use image node_id 7 for calling the TestForecasting obj's underlying member method code with example usage: obj.test_constant_mean_forecast() without return types