code: def test_download_url_existing_dir_no_slash_exception(path=None):
      with chpwd(path):
          res = download_url(
              "url", path="dir", save=False, on_failure="ignore"
          )
          assert_result_count(res, 1, status="error")
          assert_message(
              "Non-directory path given (no trailing separator) "
              "but a directory with that name (after adding "
              "archive suffix) exists",
              res,
          )
  
file_path: datalad/datalad/local/tests/test_download_url.py
imports: import os
  from os.path import join
  from datalad.api import Dataset, clone, download_url
  from datalad.tests.utils_pytest import DEFAULT_REMOTE, assert_cwd_unchanged, assert_false, assert_in, assert_in_results, assert_message, assert_not_in, assert_result_count, create_tree, eq_, ok_, ok_exists, serve_path_via_http, skip_if_no_network, slow, with_tempfile, with_tree
  from datalad.utils import Path, chpwd
label_desc: Use image node_id 2 for calling a global function with example usage: test_download_url_existing_dir_no_slash_exception(path) without return types