Error: [rast] file does not exist: /vsis3/copernicus-dem-30m/Copernicus_DSM_COG_10_N44_00_E026_00_DEM/Copernicus_DSM_COG_10_N44_00_E026_00_DEM.tif

# All functions using [`load_dem()`] store data in a cache folder.
# In order not to mess up with the user cache directory, we setup a temporary
# cache folder only used for testing purposes. This is achieved via the
# [`temp_cache_dir()`] helper function, which should be called in each test.
test_that("STAC asset urls are correctly retrieved", {
asset_urls_retrieved <- get_stac_asset_urls(bb, endpoint = ep,
test_that("load_dem correctly retrieve and merge remote data", {
dem <- load_dem(bb, asset_urls, force_download = TRUE)
test_that("Download DEM data can be retrieved from the cache on new calls", {
# calling load_dem should create a file in the cache folder
expect_message(load_dem(bb, asset_urls, force_download = TRUE),
cached_filename <- list.files(cache_dir, pattern = "^dem_")
# calling load_dem again should read data from the cached file, raising a
# warning that includes the path to the cached file as well
expect_warning(load_dem(bb, asset_urls, force_download = FALSE),
test_that("valley polygon is correctly constructed", {
expected_valley <- sf::st_read(expected_valley_path, quiet = TRUE) |>

"STAC asset urls are correctly retrieved"
"load_dem correctly retrieve and merge remote data"
"Download DEM data can be retrieved from the cache on new calls"
"valley polygon is correctly constructed"

load_dem correctly retrieve and merge remote data

Download DEM data can be retrieved from the cache on new calls