code: def test_Providers_OnStockConfiguration():
      providers = Providers.from_config_files()
      provider_names = {p.name for p in providers}
      assert_in("datalad-test-s3", provider_names)
      assert_in("crcns", provider_names)
      assert_greater(len(provider_names), 5)
      # too rigid
      # eq_(provider_names, {'crcns', 'crcns-nersc', 'hcp-http', 'hcp-s3', 'hcp-web', 'hcp-xnat', 'openfmri'})
  
      # every provider must have url_res
      for provider in providers:
          assert provider.url_res
  
      # and then that we didn't screw it up -- cycle few times to verify that we do not
      # somehow remove existing providers while dealing with that "heaplike" list
      for i in range(3):
          provider = providers.get_provider(
              "https://crcns.org/data...."
          )
          assert_equal(provider.name, "crcns")
  
          provider = providers.get_provider(
              "https://portal.nersc.gov/project/crcns/download/bogus"
          )
          assert_equal(provider.name, "crcns-nersc")
  
      assert_equal(
          providers.needs_authentication("http://google.com"), None
      )
      assert_equal(
          providers.needs_authentication("http://crcns.org/"), True
      )
      assert_equal(
          providers.needs_authentication("http://openfmri.org/"), False
      )
  
      providers_repr = repr(providers)
      # should list all the providers atm
      assert_equal(providers_repr.count("Provider("), len(providers))
  
      # Should be a lazy evaluator unless reload is specified
      assert providers is Providers.from_config_files()
      assert providers is not Providers.from_config_files(reload=True)
  
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 1 for calling a global function with example usage: test_Providers_OnStockConfiguration() without return types