code: def test_api_query_format_ranges():
      query = SentinelAPI.format_query(cloudcoverpercentage=(0, 30))
      assert query == 'cloudcoverpercentage:["0" TO "30"]'
  
      query = SentinelAPI.format_query(cloudcoverpercentage=[0, 30])
      assert query == 'cloudcoverpercentage:["0" TO "30"]'
  
      query = SentinelAPI.format_query(cloudcoverpercentage=[None, 30])
      assert query == 'cloudcoverpercentage:[* TO "30"]'
  
      query = SentinelAPI.format_query(orbitnumber=(16302, None))
      assert query == 'orbitnumber:["16302" TO *]'
  
      query = SentinelAPI.format_query(orbitnumber=(16302, "*"))
      assert query == 'orbitnumber:["16302" TO *]'
  
      for value in [(None, None), ("*", None), (None, "*"), ("*", "*")]:
          query = SentinelAPI.format_query(orbitnumber=value)
          assert query == ""
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(cloudcoverpercentage=[])
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(cloudcoverpercentage=[0])
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(cloudcoverpercentage=[0, 1, 2])
  
      with pytest.raises(ValueError):
          SentinelAPI.format_query(cloudcoverpercentage=[0, ""])
  
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 7 for calling a global function with example usage: test_api_query_format_ranges() without return types