code: def test_from_config():
      generic_url = "https://example.com/generic_ne/{name}.zip"
  
      land_downloader = cio.Downloader(generic_url, "", "")
      generic_ne_downloader = cio.Downloader(generic_url, "", "")
  
      ocean_spec = (
          "shapefile",
          "natural_earth",
          "110m",
          "physical",
          "ocean",
      )
      land_spec = (
          "shapefile",
          "natural_earth",
          "110m",
          "physical",
          "land",
      )
      generic_spec = ("shapefile", "natural_earth")
  
      target_config = {
          land_spec: land_downloader,
          generic_spec: generic_ne_downloader,
      }
  
      with config_replace(target_config):
          # ocean spec is not explicitly in the config, but a subset of it is,
          # so check that an appropriate downloader is returned
          r = cio.Downloader.from_config(ocean_spec)
  
          # check the resulting download item produces a sensible url.
          assert (
              r.url({"name": "ocean"})
              == "https://example.com/generic_ne/ocean.zip"
          )
  
          r = cio.Downloader.from_config(land_spec)
          assert r is land_downloader
  
file_path: cartopy/lib/cartopy/tests/io/test_downloaders.py
imports: import contextlib
  from pathlib import Path
  from unittest import mock
  import pytest
  import cartopy
  import cartopy.io
  from cartopy.io.shapereader import NEShpDownloader
label_desc: Use image node_id 4 for calling a global function with example usage: test_from_config() without return types