code: def test_ancient_annex():
      class _runner(object):
          def run(self, cmd, *args, **kwargs):
              if "--raw" in cmd:
                  raise CommandError
              return dict(stdout="git-annex version: 0.1", stderr="")
  
      ev = ExternalVersions()
      with patch(
          "datalad.support.external_versions._runner", _runner()
      ):
          assert_equal(ev["cmd:annex"], "0.1")
  
imports: import logging
  import pytest
  from os import linesep
  from datalad import __version__
  from datalad.cmd import StdOutErrCapture, WitlessRunner
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError, MissingExternalDependency, OutdatedExternalDependency
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_false, assert_greater, assert_greater_equal, assert_in, assert_not_in, assert_raises, assert_true, create_tree, patch, set_annex_version, swallow_logs, with_tempfile
  from ..external_versions import ExternalVersions, LooseVersion
label_desc: Use image node_id 9 for calling a global function with example usage: test_ancient_annex() and returns: dict