code: def test_make_datasource(with_nimd_env):
      pkg_def = dict(relpath="pkg")
      with TemporaryDirectory() as tmpdir:
          nibd.get_data_path = lambda: [tmpdir]
          with pytest.raises(DataError):
              make_datasource(pkg_def)
          pkg_dir = pjoin(tmpdir, "pkg")
          os.mkdir(pkg_dir)
          with pytest.raises(DataError):
              make_datasource(pkg_def)
          tmpfile = pjoin(pkg_dir, "config.ini")
          with open(tmpfile, "w") as fobj:
              fobj.write("[DEFAULT]\n")
              fobj.write("version = 0.1\n")
          ds = make_datasource(pkg_def, data_path=[tmpdir])
          assert ds.version == "0.1"
  
file_path: nibabel/nibabel/tests/test_data.py
imports: import os
  import sys
  import tempfile
  from os import environ
  from os.path import join
  from tempfile import TemporaryDirectory
  import pytest
  from ..None import data
  from ..data import Bomber, DataError, Datasource, VersionedDatasource, _cfg_value, datasource_or_bomber, find_data_dir, get_data_path, make_datasource
  from .test_environment import DATA_KEY, USER_KEY, with_environment
label_desc: Use image node_id 7 for calling a global function with example usage: test_make_datasource(with_nimd_env) without return types