forked from OceanNetworksCanada/api-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelivery.py
31 lines (19 loc) · 804 Bytes
/
delivery.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# delivery services' tests
from pathlib import Path
from common import onc
def manualRequestProduct(filters: dict):
# Manually requests data product, doesn't execute or download
return onc.requestDataProduct(filters)
def manualRunProduct(dpRequestId: int):
# Manually runs request id
return onc.runDataProduct(dpRequestId)
def manualDownloadProduct(dpRunId: int, outPath: str = "", resultsOnly: bool = False):
# Manually downloads runId
onc.outPath = outPath
return onc.downloadDataProduct(dpRunId, downloadResultsOnly=resultsOnly)
def test_getDataProductUrls(onc, filters):
print("\n9. TEST getDataProductUrls()")
res = onc.getDataProductUrls(filters)
def test_downloadFile(onc, url):
print("\n9. TEST downloadFile()")
res = onc.downloadFile(url)