code: def test_api_query_format():
      wkt = "POLYGON((0 0,1 1,0 1,0 0))"
  
      now = datetime.now()
      last_24h = format_query_date(now - timedelta(hours=24))
      query = SentinelAPI.format_query(wkt, (last_24h, now))
      assert (
          query
          == 'beginPosition:["{}" TO "{}"] '.format(
              last_24h, format_query_date(now)
          )
          + 'footprint:"Intersects(POLYGON((0 0,1 1,0 1,0 0)))"'
      )
  
      query = SentinelAPI.format_query(
          wkt, date=(last_24h, "NOW"), producttype="SLC", raw="IW"
      )
      assert (
          query
          == 'beginPosition:["{}" TO "NOW"] '.format(
              format_query_date(last_24h)
          )
          + 'producttype:"SLC" IW footprint:"Intersects(POLYGON((0 0,1 1,0 1,0 0)))"'
      )
  
      query = SentinelAPI.format_query(wkt, producttype="SLC", raw="IW")
      assert (
          query
          == 'producttype:"SLC" IW footprint:"Intersects(POLYGON((0 0,1 1,0 1,0 0)))"'
      )
  
      query = SentinelAPI.format_query(area=None, date=None)
      assert query == ""
  
      query = SentinelAPI.format_query()
      assert query == ""
  
      query = SentinelAPI.format_query(raw="test")
      assert query == "test"
  
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 5 for calling a global function with example usage: test_api_query_format() without return types