Skip to content

Commit

Permalink
update download test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellmanware committed Aug 27, 2024
1 parent 957911e commit 96188b0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions tests/testthat/test-download.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,25 @@ testthat::test_that("download_data (expected errors - acknowledgement)", {
"hms", "smoke", "gridmet",
"terraclimate", "huc", "cropscape", "cdl", "prism")
for (d in seq_along(download_datasets)) {
expect_error(
testthat::expect_error(
download_data(dataset_name = download_datasets[d],
acknowledgement = FALSE),
paste0("Please refer to the argument list and ",
"the error message above to rectify the error.\n")
acknowledgement = FALSE)
)
}
})

testthat::test_that("Error when one parameter is NULL.", {
testthat::test_that("download_data (expected errors - directory)", {
download_datasets <- c("aqs", "ecoregion", "geos", "gmted", "koppen",
"koppengeiger", "merra2", "merra", "narr",
"nlcd", "noaa", "sedac_groads",
"sedac_population", "groads", "population",
"hms", "smoke", "gridmet",
"terraclimate", "huc", "cropscape", "cdl", "prism")
for (d in seq_along(download_datasets)) {
expect_error(
testthat::expect_error(
download_data(dataset_name = download_datasets[d],
acknowledgement = TRUE,
directory_to_save = NULL),
paste0("Please refer to the argument list and ",
"the error message above to rectify the error.\n")
directory_to_save = NULL)
)
}
})
Expand Down

0 comments on commit 96188b0

Please sign in to comment.