code: def test_dryrun(path=None):
      ds = Dataset(path).create()
      # see that the correct request would be made
      res = ds.create_sibling_gin(
          "bogus", credential="some", dry_run=True
      )
      assert_result_count(res, 1)
      res = res[0]
      eq_(
          res["request_url"], "https://gin.g-node.org/api/v1/user/repos"
      )
      # we dont care much which user-agent, but there should be one
      assert_in("user-agent", res["request_headers"])
      # only a placeholder no-token makes it into the request
      assert_in(
          "NO-TOKEN-AVAILABLE", res["request_headers"]["authorization"]
      )
      # correct name
      eq_(res["request_data"]["name"], "bogus")
      # public by default
      eq_(res["request_data"]["private"], False)
      # it is important that we do not tell the portal to generate some
      # repo content
      eq_(res["request_data"]["auto_init"], False)
  
      # org repo
      res = ds.create_sibling_gin(
          "strangeorg/bogus", credential="some", dry_run=True
      )
      assert_result_count(res, 1)
      res = res[0]
      eq_(res["request_data"]["name"], "bogus")
      eq_(
          res["request_url"],
          "https://gin.g-node.org/api/v1/org/strangeorg/repos",
      )
  
      # recursive name, building
      subds = ds.create("subds")
      res = ds.create_sibling_gin(
          "bogus", recursive=True, credential="some", dry_run=True
      )
      eq_(res[-1]["request_data"]["name"], "bogus-subds")
  
      # ignore unavailable datasets
      ds.drop("subds", what="all", reckless="kill", recursive=True)
      res = ds.create_sibling_gin(
          "bogus", recursive=True, credential="some", dry_run=True
      )
      eq_(len(res), 1)
  
file_path: datalad/datalad/distributed/tests/test_create_sibling_ghlike.py
imports: import os
  from os.path import basename
  from unittest.mock import patch
  import requests
  from datalad.api import Dataset, create_sibling_gin
  from datalad.downloaders.http import DEFAULT_USER_AGENT
  from datalad.tests.utils_pytest import SkipTest, assert_in, assert_in_results, assert_raises, assert_result_count, assert_status, eq_, with_tempfile
label_desc: Use image node_id 2 for calling a global function with example usage: test_dryrun(path) without return types