code: def test_str():
      c = ct.EnsureStr()
      # this should always work
      assert_equal(c("hello"), "hello")
      assert_equal(c("7.0"), "7.0")
      # this should always fail
      assert_raises(ValueError, lambda: c(["ab"]))
      assert_raises(ValueError, lambda: c(["a", "b"]))
      assert_raises(ValueError, lambda: c(("a", "b")))
      # no automatic conversion attempted
      assert_raises(ValueError, lambda: c(7.0))
      assert_equal(c.short_description(), "str")
  
file_path: datalad/datalad/tests/test_constraints.py
imports: from datalad.tests.utils_pytest import assert_equal, assert_raises
  from ..support import constraints
label_desc: Use image node_id 4 for calling a global function with example usage: test_str() without return types