def test_download_options(self): expected = """{"node": "EE", "datasetName": "LANDSAT_8_C1", "apiKey": "USERS API KEY", "entityIds": ["LC80130292014100LGN00", "LC80130282014100LGN00"]}""" payload = payloads.download_options( "LANDSAT_8_C1", "EE", ["LC80130292014100LGN00", "LC80130282014100LGN00"], api_key="USERS API KEY") assert compare_json(payload, expected)
def download_options(dataset, entity_ids, api_key=None): api_key = _get_api_key(api_key) session = _create_session(api_key) url = '{}/download-options'.format(USGS_API) payload = payloads.download_options(dataset, entity_ids) r = session.post(url, payload) response = r.json() _check_for_usgs_error(response) return response
def download_options(dataset, node, entityids, api_key=None): api_key = _get_api_key(api_key) url = '{}/downloadoptions'.format(USGS_API) payload = { "jsonRequest": payloads.download_options(dataset, node, entityids, api_key=api_key) } r = requests.post(url, payload) response = r.json() _check_for_usgs_error(response) return response
def test_download_options(self): expected = """{"datasetName": "LANDSAT_8_C1", "entityIds": ["LC80130292014100LGN00", "LC80130282014100LGN00"]}""" payload = payloads.download_options( "LANDSAT_8_C1", ["LC80130292014100LGN00", "LC80130282014100LGN00"]) assert compare_json(payload, expected)
def test_download_options(self): expected = """{"node": "EE", "datasetName": "LANDSAT_8_C1", "apiKey": "USERS API KEY", "entityIds": ["LC80130292014100LGN00", "LC80130282014100LGN00"]}""" payload = payloads.download_options("LANDSAT_8_C1", "EE", ["LC80130292014100LGN00", "LC80130282014100LGN00"], api_key="USERS API KEY") assert compare_json(payload, expected)