code: def test_single_objective_from_botorch(self) -> None:
      for botorch_test_problem in [
          Ackley(),
          ConstrainedHartmann(dim=6),
      ]:
          test_problem = (
              SingleObjectiveBenchmarkProblem.from_botorch_synthetic(
                  test_problem_class=botorch_test_problem.__class__,
                  test_problem_kwargs={},
                  num_trials=1,
              )
          )
  
          # Test search space
          self.assertEqual(
              len(test_problem.search_space.parameters),
              botorch_test_problem.dim,
          )
          self.assertEqual(
              len(test_problem.search_space.parameters),
              len(test_problem.search_space.range_parameters),
          )
          self.assertTrue(
              all(
                  # pyre-fixme[16]: `Parameter` has no attribute `lower`.
                  test_problem.search_space.range_parameters[
                      f"x{i}"
                  ].lower
                  == botorch_test_problem._bounds[i][0]
                  for i in range(botorch_test_problem.dim)
              ),
              "Parameters' lower bounds must all match Botorch problem's bounds.",
          )
          self.assertTrue(
              all(
                  # pyre-fixme[16]: `Parameter` has no attribute `upper`.
                  test_problem.search_space.range_parameters[
                      f"x{i}"
                  ].upper
                  == botorch_test_problem._bounds[i][1]
                  for i in range(botorch_test_problem.dim)
              ),
              "Parameters' upper bounds must all match Botorch problem's bounds.",
          )
  
          # Test optimum
          self.assertEqual(
              test_problem.optimal_value,
              botorch_test_problem._optimal_value,
          )
          # test optimization config
          self.assertEqual(
              test_problem.optimization_config.objective.metric.name,
              test_problem.name,
          )
          self.assertTrue(
              test_problem.optimization_config.objective.minimize
          )
          # test repr method
          if isinstance(botorch_test_problem, Ackley):
              self.assertEqual(
                  test_problem.optimization_config.outcome_constraints,
                  [],
              )
              expected_repr = (
                  "SingleObjectiveBenchmarkProblem(name=Ackley, "
                  "optimization_config=OptimizationConfig(objective=Objective("
                  'metric_name="Ackley", '
                  "minimize=True), outcome_constraints=[]), "
                  "num_trials=1, "
                  "infer_noise=True, "
                  "tracking_metrics=[])"
              )
          else:
              outcome_constraint = (
                  test_problem.optimization_config.outcome_constraints[
                      0
                  ]
              )
              self.assertEqual(
                  outcome_constraint.metric.name, "constraint_slack_0"
              )
              self.assertEqual(outcome_constraint.op, ComparisonOp.GEQ)
              self.assertFalse(outcome_constraint.relative)
              self.assertEqual(outcome_constraint.bound, 0.0)
              expected_repr = (
                  "SingleObjectiveBenchmarkProblem(name=ConstrainedHartmann, "
                  "optimization_config=OptimizationConfig(objective=Objective("
                  'metric_name="ConstrainedHartmann", minimize=True), '
                  "outcome_constraints=[OutcomeConstraint(constraint_slack_0"
                  " >= 0.0)]), num_trials=1, infer_noise=True, "
                  "tracking_metrics=[])"
              )
  
          self.assertEqual(repr(test_problem), expected_repr)
  
file_path: Ax/ax/benchmark/tests/test_benchmark_problem.py
imports: from typing import List, Optional, Union
  from ax.benchmark.benchmark_problem import MultiObjectiveBenchmarkProblem, SingleObjectiveBenchmarkProblem
  from ax.core.types import ComparisonOp
  from ax.metrics.botorch_test_problem import BotorchTestProblemMetric
  from ax.runners.botorch_test_problem import BotorchTestProblemRunner
  from ax.utils.common.testutils import TestCase
  from ax.utils.common.typeutils import checked_cast
  from botorch.test_functions.multi_objective import BraninCurrin
  from botorch.test_functions.synthetic import Ackley, ConstrainedGramacy, ConstrainedHartmann
  from hypothesis import given, strategies
label_desc: Use image node_id 1 for calling the TestBenchmarkProblem obj's underlying member method code with example usage: obj.test_single_objective_from_botorch() without return types