code: def test_version_base_1_2(
      self,
      config_path: str,
      expected_list: List[InputDefault],
      version_base: Optional[str],
      hydra_restore_singletons: Any,
  ) -> None:
      version.setbase(version_base)
      repo = create_repo()
      err = "In optional_deprecated: Too many keys in default item {'group1': 'file1', 'optional': True}"
      with raises(
          ValueError,
          match=re.escape(err),
      ):
          repo.load_config(config_path=config_path)
  
imports: import re
  from textwrap import dedent
  from typing import Any, List, Optional
  from pytest import mark, param, raises, warns
  from hydra import version
  from hydra._internal.defaults_list import create_defaults_list
  from hydra.core.default_element import ConfigDefault, GroupDefault, InputDefault, ResultDefault
  from hydra.core.override_parser.overrides_parser import OverridesParser
  from hydra.core.plugins import Plugins
  from hydra.errors import ConfigCompositionException
  from hydra.test_utils.test_utils import chdir_hydra_root
  from tests.defaults_list import create_repo
label_desc: Use image node_id 2 for calling the TestDeprecatedOptional obj's underlying member method code with example usage: obj.test_version_base_1_2(config_path, expected_list, version_base, hydra_restore_singletons) without return types