code: def test_substitution_config():
      # use a shim to avoid having to create an actual dataset
      # the tested function only needs a `ds.config` to be a ConfigManager
      from datalad import cfg
  
      class dset:
          config = cfg
  
      # empty be default
      eq_(_get_substitutions(dset), {})
      # basic access
      with patch_config({"datalad.run.substitutions.dummy": "ork"}):
          eq_(_get_substitutions(dset), dict(dummy="ork"))
      # can report multi-value
      with patch_config(
          {"datalad.run.substitutions.dummy": ["a", "b"]}
      ):
          eq_(_get_substitutions(dset), dict(dummy=["a", "b"]))
  
          # verify combo with iospec formatting
          eq_(
              _format_iospecs(["{dummy}"], **_get_substitutions(dset)),
              ["a", "b"],
          )
  
imports: import logging
  import os
  import os.path
  import sys
  from os import mkdir, remove
  from unittest.mock import patch
  from datalad.api import clone, run
  from datalad.cli.main import main
  from datalad.core.local.run import _format_iospecs, _get_substitutions, format_command, run_command
  from datalad.distribution.dataset import Dataset
  from datalad.support.exceptions import CommandError, IncompleteResultsError, NoDatasetFound
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, OBSCURE_FILENAME, assert_false, assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, neq_, ok_, ok_exists, ok_file_has_content, patch_config, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import chpwd, ensure_unicode, on_windows
label_desc: Use image node_id 23 for calling a global function with example usage: test_substitution_config() without return types