code: def test_error(self):
      with pytest.raises(
          RuntimeError, match="We don't support input x directly"
      ):
          self.model.predict(x=1)
  
      with pytest.raises(
          RuntimeError, match="We don't support input x directly"
      ):
          self.model.evaluate(
              x=1, y=np.random.rand(self.num_samples, self.horizon)
          )
  
      with pytest.raises(RuntimeError, match="Input invalid y of None"):
          self.model.evaluate(y=None)
  
      with pytest.raises(
          Exception,
          match="Needs to call fit_eval or restore first before calling predict",
      ):
          self.model.predict(x=None)
  
      with pytest.raises(
          Exception,
          match="Needs to call fit_eval or restore first before calling predict",
      ):
          self.model.evaluate(
              y=np.random.rand(self.num_samples, self.horizon)
          )
  
      with pytest.raises(RuntimeError, match="Input invalid x of None"):
          self.model.fit_incremental(x=None)
  
      with pytest.raises(
          Exception,
          match="Needs to call fit_eval or restore first before "
          "calling fit_incremental",
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon)
          )
  
      self.model.fit_eval(data=(self.Ymat, None), **self.config)
      with pytest.raises(
          Exception,
          match=f"Expected incremental input with {self.num_samples} "
          f"time series, got {self.num_samples - 1} instead",
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples - 1, self.horizon)
          )
  
      with pytest.raises(
          RuntimeError, match="but invalid covariates in fit. "
      ):
          self.model.predict(
              horizon=self.horizon,
              future_covariates=np.random.randn(3, self.horizon),
          )
      with pytest.raises(
          RuntimeError, match="but invalid dti in fit. "
      ):
          self.model.predict(
              horizon=self.horizon,
              future_dti=pd.date_range(
                  "20130101", periods=self.horizon
              ),
          )
      with pytest.raises(
          RuntimeError, match="but invalid covariates in fit. "
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon),
              covariates_new=np.random.randn(3, self.horizon),
          )
      with pytest.raises(
          RuntimeError, match="but invalid dti in fit. "
      ):
          self.model.fit_incremental(
              x=np.random.rand(self.num_samples, self.horizon),
              dti_new=pd.date_range("20130101", periods=self.horizon),
          )
  
file_path: BigDL/python/chronos/test/bigdl/chronos/model/test_TCMF.py
imports: import pytest
  from unittest import TestCase
  from ..None import op_torch, op_distributed
  import numpy
  import os
  from numpy.testing import assert_array_almost_equal
  import pandas
  from bigdl.chronos.utils import LazyImport
label_desc: Use image node_id 5 for calling the TestTCMF obj's underlying member method code with example usage: obj.test_error() without return types