code: def test_end_trial_success(self):
      self._tuner_with_hparams()
      self.mock_client.complete_trial.return_value = {
          "name": "1",
          "state": "COMPLETED",
          "parameters": [
              {"parameter": "learning_rate", "floatValue": 0.01}
          ],
          "finalMeasurement": {
              "stepCount": "3",
              "metrics": [{"metric": "val_acc", "value": 0.7}],
          },
          "trial_infeasible": False,
          "infeasible_reason": None,
      }
      mock_save_trial = mock.Mock()
      self.tuner.oracle._save_trial = mock_save_trial
      self.tuner.oracle.ongoing_trials = {"tuner_0": self._test_trial}
      expected_trial = trial_module.Trial(
          hyperparameters=self._test_hyperparameters,
          trial_id="1",
          status=trial_module.TrialStatus.COMPLETED,
      )
      expected_trial.best_step = 3
      expected_trial.score = 0.7
  
      self.tuner.oracle.end_trial(trial_id="1")
  
      self.mock_client.complete_trial.assert_called_once_with(
          "1", False, None
      )
      self.assertEqual(
          repr(mock_save_trial.call_args[0][0].get_state()),
          repr(expected_trial.get_state()),
      )
  
imports: import os
  import time
  from keras_tuner.engine import hypermodel
  from keras_tuner.engine import hyperparameters
  from keras_tuner.engine import oracle
  from keras_tuner.engine import trial
  from keras_tuner.engine import tuner
  import mock
  import tensorflow
  from tensorboard.plugins.hparams import api
  from tensorflow_cloud.core import deploy
  from tensorflow_cloud.core import machine_config
  from tensorflow_cloud.core import validate
  from tensorflow_cloud.tuner import cloud_fit_client
  from tensorflow_cloud.tuner import tuner
  from tensorflow_cloud.tuner.tuner import vizier_client
  from tensorflow_cloud.utils import google_api_client
  from tensorflow_cloud.utils import tf_utils
label_desc: Use image node_id 17 for calling the CloudTunerTest obj's underlying member method code with example usage: obj.test_end_trial_success() without return types