test_that(".get_teow works", { skip_on_cran() aoi <- read_sf( system.file("extdata", "shell_beach_protected_area_41057_B.gpkg", package = "mapme.biodiversity" ) ) aoi <- suppressWarnings(st_cast(aoi, to = "POLYGON")[1, ]) temp_loc <- file.path(tempdir(), "mapme.biodiversity") dir.create(temp_loc, showWarnings = FALSE) resource_dir <- system.file("res", package = "mapme.biodiversity") file.copy(resource_dir, temp_loc, recursive = TRUE) outdir <- file.path(tempdir(), "mapme.biodiversity", "res") tmpdir <- tempdir() portfolio <- init_portfolio(aoi, years = 2000:2010, outdir = outdir, tmpdir = tmpdir, verbose = FALSE ) # Add testing attribute in order to skip downloads attributes(portfolio)$testing <- TRUE expect_equal( .get_teow(portfolio, rundir = file.path(outdir, "teow")) %>% basename(), "wwf_terr_ecos.gpkg" ) })