code: def test_api_query_format_dates():
      query = SentinelAPI.format_query(
          ingestiondate=("NOW-1DAY", "NOW")
      )
      assert query == 'ingestiondate:["NOW-1DAY" TO "NOW"]'
  
      query = SentinelAPI.format_query(
          ingestiondate=(date(2017, 1, 1), "20170203")
      )
      assert (
          query
          == 'ingestiondate:["2017-01-01T00:00:00Z" TO "2017-02-03T00:00:00Z"]'
      )
  
      query = SentinelAPI.format_query(
          ingestiondate="[NOW-1DAY TO NOW]"
      )
      assert query == "ingestiondate:[NOW-1DAY TO NOW]"
  
      query = SentinelAPI.format_query(ingestiondate=[None, "NOW"])
      assert query == 'ingestiondate:[* TO "NOW"]'
  
      for value in [(None, None), ("*", None), (None, "*"), ("*", "*")]:
          query = SentinelAPI.format_query(ingestiondate=value)
          assert query == ""
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(date="NOW")
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(date=["NOW"])
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(ingestiondate=[])
  
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 9 for calling a global function with example usage: test_api_query_format_dates() without return types