class_docstr: Test behaviour of query and interventions
docstr: An error should be raised if query before CPDs are fit
code: def test_query_when_cpds_not_fit(
      self, train_data_idx, train_data_discrete
  ):
      """An error should be raised if query before CPDs are fit"""
  
      bn = BayesianNetwork(
          from_pandas(train_data_idx, w_threshold=0.3)
      ).fit_node_states(train_data_discrete)
  
      with pytest.raises(
          ValueError,
          match=r"Bayesian Network does not contain any CPDs.*",
      ):
          InferenceEngine(bn)
  
imports: import math
  import pytest
  from causalnex.inference import InferenceEngine
  from causalnex.network import BayesianNetwork
  from causalnex.structure import StructureModel
  from causalnex.structure.notears import from_pandas
label_desc: Use image node_id 1 for calling the TestInferenceEngineDiscrete obj's underlying member method code with example usage: obj.test_query_when_cpds_not_fit(train_data_idx, train_data_discrete) without return types