code: def _test_setup_store(io_cls, io_args, store=None):
      io = io_cls(*io_args)
      store = Path(store)
      version_file = store / "ria-layout-version"
      error_logs = store / "error_logs"
  
      # invalid version raises:
      assert_raises(UnknownLayoutVersion, create_store, io, store, "2")
  
      # non-existing path should work:
      create_store(io, store, "1")
      assert_true(version_file.exists())
      assert_true(error_logs.exists())
      assert_true(error_logs.is_dir())
      assert_equal([f for f in error_logs.iterdir()], [])
  
      # empty target directory should work as well:
      rmtree(str(store))
      store.mkdir(exist_ok=False)
      create_store(io, store, "1")
      assert_true(version_file.exists())
      assert_true(error_logs.exists())
      assert_true(error_logs.is_dir())
      assert_equal([f for f in error_logs.iterdir()], [])
  
      # re-execution also fine:
      create_store(io, store, "1")
  
      # but version conflict with existing target isn't:
      version_file.write_text("2|unknownflags\n")
      assert_raises(ValueError, create_store, io, store, "1")
  
file_path: datalad/datalad/customremotes/tests/test_ria_utils.py
imports: import tempfile
  from os.path import join
  from urllib.parse import quote
  from datalad.customremotes import ria_utils
  from datalad.customremotes.ria_utils import UnknownLayoutVersion, create_ds_in_store, create_store, verify_ria_url
  from datalad.distributed.ora_remote import LocalIO, SSHRemoteIO
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_raises, assert_true, rmtree, skip_ssh, with_tempfile
  from datalad.utils import Path, on_windows
label_desc: Use image node_id 1 for calling a global function with example usage: _test_setup_store(io_cls, io_args, store) without return types