# schema_salad.tests.test_fetch

## Classes

`testFetcher` | Fetch resources from URIs.
`CWLTestFetcher` | Fetch resources from URIs.

## Functions

`test_fetcher`() |
`test_cache`() |

## Module Contents

class schema_salad.tests.test_fetch.testFetcher(cache, session)

  Bases: `schema_salad.fetcher.Fetcher`

  digraph inheritancecce3809c86 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Fetcher" [URL="../../fetcher/index.html#schema_salad.fetcher.Fetcher",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fetch resources from URIs."]; "ABC" -> "Fetcher" [arrowsize=0.5,style="setlinewidth(0.5)"]; "testFetcher" [URL="#schema_salad.tests.test_fetch.testFetcher",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Fetcher" -> "testFetcher" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

  Fetch resources from URIs.

  Parameters:

    - cache (schema_salad.utils.CacheType)

    - session (Optional[requests.sessions.Session])

  fetch_text(url, content_types=None)

    Retrieve the given resource as a string.

    Parameters:

      - url (str)

      - content_types (Optional[list[str]])

    Return type:

      str

  check_exists(url)

    Check if the given resource exists.

    Parameters:

      url (str)

    Return type:

      bool

  urljoin(base, url)

    Construct a full (“absolute”) URL by combining a “base URL” with another URL.

    Parameters:

      - base (str)

      - url (str)

    Return type:

      str

class schema_salad.tests.test_fetch.CWLTestFetcher(cache, session)

  Bases: `schema_salad.fetcher.Fetcher`

  digraph inheritance2a94a1de47 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "CWLTestFetcher" [URL="#schema_salad.tests.test_fetch.CWLTestFetcher",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Fetcher" -> "CWLTestFetcher" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Fetcher" [URL="../../fetcher/index.html#schema_salad.fetcher.Fetcher",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fetch resources from URIs."]; "ABC" -> "Fetcher" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

  Fetch resources from URIs.

  Parameters:

    - cache (schema_salad.utils.CacheType)

    - session (Optional[requests.sessions.Session])

  fetch_text(url, content_types=None)

    Retrieve the given resource as a string.

    Parameters:

      - url (str)

      - content_types (Optional[list[str]])

    Return type:

      str

  check_exists(url)

    Check if the given resource exists.

    Parameters:

      url (str)

    Return type:

      bool

  urljoin(base, url)

    Construct a full (“absolute”) URL by combining a “base URL” with another URL.

    Parameters:

      - base (str)

      - url (str)

    Return type:

      str

schema_salad.tests.test_fetch.test_fetcher()
  Return type:

    None

schema_salad.tests.test_fetch.test_cache()
  Return type:

    None