code: def test_download_url_exceptions():
      res0 = download_url(
          ["url1", "url2"],
          path=__file__,
          save=False,
          on_failure="ignore",
      )
      assert_result_count(res0, 1, status="error")
      assert_message(
          "When specifying multiple urls, --path should point to "
          "a directory target (with a trailing separator). Got %r",
          res0,
      )
  
      res1 = download_url(
          "http://example.com/bogus", save=False, on_failure="ignore"
      )
      assert_result_count(res1, 1, status="error")
      msg = res1[0]["message"]
      # when running under bogus proxy, on older systems we could get
      # no URL reported in the message
      if not (
          "Cannot connect to proxy." in msg
          or "Temporary failure in name resolution" in msg
          or "Name or service not known" in msg  # nd80
          or "Failed to establish a new session"
          in msg  # Debian sid @ 20220121
      ):
          assert_in("http://example.com/bogus", msg)
  
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 1 for calling a global function with example usage: test_download_url_exceptions() without return types