本文整理汇总了Python中sentinelsat.SentinelAPI._trigger_offline_retrieval方法的典型用法代码示例。如果您正苦于以下问题:Python SentinelAPI._trigger_offline_retrieval方法的具体用法?Python SentinelAPI._trigger_offline_retrieval怎么用?Python SentinelAPI._trigger_offline_retrieval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentinelsat.SentinelAPI
的用法示例。
在下文中一共展示了SentinelAPI._trigger_offline_retrieval方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_trigger_lta_failed
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import _trigger_offline_retrieval [as 别名]
def test_trigger_lta_failed(http_status_code):
api = SentinelAPI("mock_user", "mock_password")
request_url = "https://scihub.copernicus.eu/apihub/odata/v1/Products('8df46c9e-a20c-43db-a19a-4240c2ed3b8b')/$value"
with requests_mock.mock() as rqst:
rqst.get(
request_url,
status_code=http_status_code
)
with pytest.raises(SentinelAPILTAError) as excinfo:
api._trigger_offline_retrieval(request_url)
示例2: test_trigger_lta_accepted
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import _trigger_offline_retrieval [as 别名]
def test_trigger_lta_accepted():
api = SentinelAPI("mock_user", "mock_password")
request_url = "https://scihub.copernicus.eu/apihub/odata/v1/Products('8df46c9e-a20c-43db-a19a-4240c2ed3b8b')/$value"
with requests_mock.mock() as rqst:
rqst.get(
request_url,
text="Mock trigger accepted", status_code=202
)
assert api._trigger_offline_retrieval(request_url) == 202