class_docstr: Tests saving/loading functionality of WithDBSettingsBase class.
class_docstr_tok: ["Tests","saving\/loading","functionality","of","WithDBSettingsBase","class","."]
code: def test_updated_trials_mini_batch(self) -> None:
      experiment, _ = self.init_experiment_and_generation_strategy(
          save_generation_strategy=False
      )
  
      # Check with 1 trial.
      trial = experiment.new_trial()
      self.assertIsNone(trial.db_id)
      self.with_db_settings._save_or_update_trials_in_db_if_possible(
          experiment=experiment,
          trials=[trial],
      )
      loaded_experiment = _load_experiment(
          experiment.name,
          decoder=self.with_db_settings.db_settings.decoder,
      )
      self.assertEqual(
          # pyre-fixme[16]: Optional type has no attribute `status`.
          loaded_experiment.trials.get(trial.index).status,
          TrialStatus.CANDIDATE,
      )
      self.assertIsNotNone(trial.db_id)
  
      # Check with multiple trials, where their number % mini batch size is not 0.
      trials = [experiment.new_trial() for _ in range(5)]
      for t in trials:
          self.assertIsNone(t.db_id)
  
      trial.mark_running(no_runner_required=True)
      trials.append(trial)
  
      self.with_db_settings._save_or_update_trials_in_db_if_possible(
          experiment=experiment,
          # pyre-fixme[6]: For 2nd param expected `List[BaseTrial]` but got
          #  `List[Trial]`.
          trials=trials,
      )
      loaded_experiment = _load_experiment(
          experiment.name,
          decoder=self.with_db_settings.db_settings.decoder,
      )
      # All trials except for the one we marked as running should be candidates.
      for t in trials:
          self.assertIsNotNone(t.db_id)
          if t.index != trial.index:
              self.assertEqual(t.status, TrialStatus.CANDIDATE)
          else:
              self.assertEqual(t.status, TrialStatus.RUNNING)
  
imports: import random
  import string
  from typing import Tuple
  from unittest.mock import patch
  from ax.core.base_trial import TrialStatus
  from ax.core.experiment import Experiment
  from ax.modelbridge.generation_strategy import GenerationStrategy
  from ax.service.utils.with_db_settings_base import WithDBSettingsBase
  from ax.storage.sqa_store.db import init_test_engine_and_session_factory
  from ax.storage.sqa_store.load import _load_experiment, _load_generation_strategy_by_experiment_name
  from ax.storage.sqa_store.reduced_state import GR_LARGE_MODEL_ATTRS
  from ax.storage.sqa_store.save import _save_experiment, _save_generation_strategy, _save_or_update_trials
  from ax.storage.sqa_store.structs import DBSettings
  from ax.utils.common.testutils import TestCase
  from ax.utils.testing.core_stubs import get_experiment, get_generator_run, SpecialGenerationStrategy
  from ax.utils.testing.modeling_stubs import get_generation_strategy
label_desc: Use image node_id 15 for calling the TestWithDBSettingsBase obj's underlying member method code with example usage: obj.test_updated_trials_mini_batch() without return types