|
| 1 | +from pathlib import Path |
| 2 | +from dem_handler.download.aio_aws import bulk_download_dem_tiles #, bulk_upload_dem_tiles |
| 3 | +from botocore.config import Config |
| 4 | + |
| 5 | +CURRENT_DIR = Path(__file__).parent.resolve() |
| 6 | +TMP_PATH = CURRENT_DIR / "TMP/Async_Test" |
| 7 | + |
| 8 | +S3_BUCKET = "deant-data-public-dev" |
| 9 | +REMOTE_DIR = "persistent/repositories/dem-handler/async_test/" |
| 10 | +REMOTE_FILES = [ |
| 11 | + "Copernicus_DSM_COG_10_N00_00_E009_00_DEM.tif", |
| 12 | + "Copernicus_DSM_COG_10_N00_00_E010_00_DEM.tif", |
| 13 | + "Copernicus_DSM_COG_10_N00_00_E011_00_DEM.tif", |
| 14 | + "Copernicus_DSM_COG_10_N00_00_E013_00_DEM.tif", |
| 15 | + "Copernicus_DSM_COG_10_N00_00_E014_00_DEM.tif", |
| 16 | + "Copernicus_DSM_COG_10_N00_00_E017_00_DEM.tif", |
| 17 | +] |
| 18 | +tile_objects = [REMOTE_DIR / Path(rf) for rf in REMOTE_FILES] |
| 19 | + |
| 20 | +CONFIG = Config( |
| 21 | + region_name="ap-southeast-2", |
| 22 | + retries={"max_attempts": 3, "mode": "standard"}, |
| 23 | +) |
| 24 | + |
| 25 | + |
| 26 | +def test_bulk_download(): |
| 27 | + bulk_download_dem_tiles(tile_objects, TMP_PATH, S3_BUCKET, CONFIG, 2, 2) |
| 28 | + |
| 29 | + |
| 30 | +# This needs AWS access keys, we should provid them if this test needs to run. |
| 31 | +# def test_bulk_upload(): |
| 32 | +# bulk_upload_dem_tiles(REMOTE_DIR, TMP_PATH, S3_BUCKET, CONFIG, 2, 2) |
0 commit comments