code: def test_get_downloader_class():
      url = "http://example.com"
  
      with patch.object(
          external_versions, "_versions", {"requests": 1}
      ):
          assert Provider._get_downloader_class(url) is HTTPDownloader
  
      with patch.object(
          external_versions, "_versions", {"requests": None}
      ):
          with assert_raises(RuntimeError) as cmr:
              Provider._get_downloader_class(url)
          assert_in("you need 'requests'", str(cmr.value))
  
file_path: datalad/datalad/downloaders/tests/test_providers.py
imports: import logging
  import os.path
  from unittest.mock import patch
  from ...support.external_versions import external_versions
  from ...tests.utils_pytest import assert_equal, assert_false, assert_greater, assert_in, assert_raises, ok_exists, swallow_logs, with_tempfile, with_testsui, with_tree
  from ...utils import chpwd, create_tree
  from ..providers import HTTPDownloader, Provider, Providers
label_desc: Use image node_id 4 for calling a global function with example usage: test_get_downloader_class() without return types