code: def test_Init(self) -> None:
      self.assertEqual(
          # pyre-fixme[16]: Optional type has no attribute `outcome_constraints`.
          len(
              self.unweighted_run.optimization_config.outcome_constraints
          ),
          len(self.optimization_config.outcome_constraints),
      )
      self.assertEqual(
          # pyre-fixme[16]: Optional type has no attribute `parameters`.
          len(self.unweighted_run.search_space.parameters),
          len(self.search_space.parameters),
      )
      self.assertEqual(str(self.unweighted_run), GENERATOR_RUN_STR)
      self.assertIsNotNone(self.unweighted_run.time_created)
      self.assertEqual(self.unweighted_run.generator_run_type, None)
      self.assertEqual(self.unweighted_run.fit_time, 4.0)
      self.assertEqual(self.unweighted_run.gen_time, 10.0)
  
      with self.assertRaises(ValueError):
          GeneratorRun(
              arms=self.arms,
              weights=[],
              optimization_config=self.optimization_config,
              search_space=self.search_space,
          )
  
      with self.assertRaises(ValueError):
          GeneratorRun(arms=self.arms, model_kwargs={"a": 1})
      with self.assertRaises(ValueError):
          GeneratorRun(
              arms=self.arms, model_key="b", bridge_kwargs={"a": 1}
          )
  
      # Check that an error will be raised if cand. metadata contains an arm
      # signature that doesn't match any arms in generator run.
      with self.assertRaisesRegex(
          ValueError, ".* in candidate metadata, but not"
      ):
          GeneratorRun(
              arms=self.arms,
              candidate_metadata_by_arm_signature={
                  "not_a_signature": {"md_key": "md_val"}
              },
          )
  
file_path: Ax/ax/core/tests/test_generator_run.py
imports: from ax.core.arm import Arm
  from ax.core.generator_run import GeneratorRun
  from ax.exceptions.core import UnsupportedError
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_arms, get_model_predictions, get_model_predictions_per_arm, get_optimization_config, get_search_space
label_desc: Use image node_id 2 for calling the GeneratorRunTest obj's underlying member method code with example usage: obj.test_Init() without return types