code: def test_format_url(api):
      start_row = 0
      url = api._format_url(offset=start_row)
      assert (
          url
          == "https://apihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}".format(
              rows=api.page_size, start=start_row
          )
      )
      limit = 50
      url = api._format_url(limit=limit, offset=start_row)
      assert (
          url
          == "https://apihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}".format(
              rows=limit, start=start_row
          )
      )
      url = api._format_url(limit=api.page_size + 50, offset=start_row)
      assert (
          url
          == "https://apihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}".format(
              rows=api.page_size, start=start_row
          )
      )
      url = api._format_url(
          order_by="beginposition desc",
          limit=api.page_size + 50,
          offset=10,
      )
      assert (
          url
          == "https://apihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}"
          "&orderby={orderby}".format(
              rows=api.page_size, start=10, orderby="beginposition desc"
          )
      )
  
imports: from contextlib import contextmanager
  from datetime import datetime, date, timedelta
  import pytest
  import requests_mock
  from requests.exceptions import StreamConsumedError, ContentDecodingError, InvalidProxyURL, InvalidHeader, TooManyRedirects, ReadTimeout, SSLError
  from sentinelsat import format_query_date, SentinelAPI
  from sentinelsat.exceptions import QuerySyntaxError, QueryLengthError, UnauthorizedError
  from sentinelsat.sentinel import _format_order_by
label_desc: Use image node_id 12 for calling a global function with example usage: test_format_url(api) without return types