Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ropensci/rgbif
Browse files Browse the repository at this point in the history
  • Loading branch information
John Waller committed Apr 24, 2024
2 parents 6cb2c4f + 6f85d3b commit 632d019
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/download_predicate_dsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,10 @@ sub_str <- function(str, max = 100) {
}
parse_predicates <- function(user, email, type, format, ...) {
tmp <- list(...)
clzzs <- vapply(tmp,
if(length(tmp) == 0) {
stop("You are requesting a full download. Please use a predicate to filter the data. For example, pred_default().")
}
clzzs <- vapply(tmp,
function(z) inherits(z, c("verbatim_extensions","occ_predicate", "occ_predicate_list")),
logical(1)
)
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-occ_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ test_that("occ_download: real requests work", {
"http://rs.gbif.org/terms/1.0/DNADerivedData")
expect_equal(length(occ_download_meta(v)$request$verbatimExtensions),2)

# check that full downloads fail well
expect_error(occ_download(), "You are requesting a full download. Please use a predicate to filter the data. For example, pred_default().")

})


Expand Down

0 comments on commit 632d019

Please sign in to comment.