Skip to content

Commit

Permalink
Merge pull request #224 from AtlasOfLivingAustralia/articles-sb
Browse files Browse the repository at this point in the history
Minor edits & updates to vignettes
  • Loading branch information
daxkellie authored Dec 14, 2023
2 parents aec0acd + 7c11b04 commit c874077
Show file tree
Hide file tree
Showing 14 changed files with 1,383 additions and 1,242 deletions.
32 changes: 16 additions & 16 deletions tests/testthat/test-search_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# (these are probably not built for many fast queries if output is large)

test_that("search_all checks inputs, returns helpful error", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
expect_error(search_all(attributes, ""), "Unrecognised metadata requested")
})

test_that("search_all returns correct output for type", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
fields <- search_all(fields, "year")
reasons <- search_all(reasons, "genus")
profiles <- search_all(profiles, "ala")
Expand All @@ -28,13 +28,13 @@ test_that("search_all returns correct output for type", {
})

test_that("search_all returns error when missing query", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
expect_error(search_all(profiles), "We didn't detect a search query")
expect_error(search_all(fields, blah))
})

test_that("search_assertions returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_assertions()
search <- search_assertions("INVALID")
search2 <- search_all(assertions, "INVALID")
Expand All @@ -50,7 +50,7 @@ test_that("search_assertions returns a filtered result", {
})

test_that("search_apis returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_apis()
search <- search_apis("image")
search2 <- search_all(apis, "image")
Expand All @@ -65,7 +65,7 @@ test_that("search_apis returns a filtered result", {
})

test_that("search_atlases returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_atlases()
search <- search_atlases("guat")
search2 <- search_all(atlases, "guat")
Expand All @@ -80,7 +80,7 @@ test_that("search_atlases returns a filtered result", {
})

test_that("search_collections returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_collections()
search <- search_collections("dna")
search2 <- search_all(collections, "dna")
Expand All @@ -95,7 +95,7 @@ test_that("search_collections returns a filtered result", {
})

test_that("search_datasets returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_datasets()
search <- search_datasets("endangered")
search2 <- search_all(datasets, "endangered")
Expand All @@ -110,7 +110,7 @@ test_that("search_datasets returns a filtered result", {
})

test_that("search_fields returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_fields()
search <- search_fields("precipitation")
search2 <- search_all(fields, "precipitation")
Expand All @@ -125,12 +125,12 @@ test_that("search_fields returns a filtered result", {
})

test_that("search_fields helpful warning with blank argument", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
expect_error(search_fields(), "We didn't detect a search query.")
})

test_that("search_licenses returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_licences()
search <- search_licences("3.0")
search2 <- search_all(licences, "3.0")
Expand All @@ -145,7 +145,7 @@ test_that("search_licenses returns a filtered result", {
})

test_that("search_lists returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_lists()
search <- search_lists("threatened")
search2 <- search_all(lists, "threatened")
Expand All @@ -160,7 +160,7 @@ test_that("search_lists returns a filtered result", {
})

test_that("search_reasons returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_reasons()
search <- search_reasons("sci")
search2 <- search_all(reasons, "sci")
Expand All @@ -175,7 +175,7 @@ test_that("search_reasons returns a filtered result", {
})

test_that("search_ranks returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_ranks()
search <- search_ranks("kingdom")
search2 <- search_all(ranks, "kingdom")
Expand All @@ -190,7 +190,7 @@ test_that("search_ranks returns a filtered result", {
})

test_that("search_profiles returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_profiles()
search <- search_profiles("base")
search2 <- search_all(profiles, "base")
Expand All @@ -205,7 +205,7 @@ test_that("search_profiles returns a filtered result", {
})

test_that("search_providers returns a filtered result", {
skip_if_offline(); skip_on_ci()
skip_on_cran(); skip_if_offline(); skip_on_ci()
all <- show_all_providers()
search <- search_providers("inaturalist")
search2 <- search_all(providers, "inaturalist")
Expand Down
Loading

0 comments on commit c874077

Please sign in to comment.