Skip to content

Commit

Permalink
Check API endpoint URLs for APIs that aren't subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Apr 1, 2024
1 parent bcc0d8f commit 558c3bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-resolve_phylopic.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ test_that("resolve_phylopic works with GBIF", {

test_that("resolve_phylopic works with EOL", {
skip_if_offline(host = "eol.org")
tryCatch(check_url("https://eol.org/api/search/1.0.json"),
error = function(e) skip())
skip_if_offline(host = "api.phylopic.org")
res <- resolve_phylopic(name = "Enhydra lutris", api = "eol.org")
expect_equal(length(res), 1)
Expand Down Expand Up @@ -66,6 +68,8 @@ test_that("resolve_phylopic works with EOL", {

test_that("resolve_phylopic works with WoRMS", {
skip_if_offline(host = "marinespecies.org")
tryCatch(check_url("https://www.marinespecies.org/rest/"),
error = function(e) skip())
skip_if_offline(host = "api.phylopic.org")
res <- resolve_phylopic(name = "Enhydra lutris", api = "marinespecies.org")
expect_equal(length(res), 1)
Expand All @@ -92,6 +96,8 @@ test_that("resolve_phylopic works with WoRMS", {

test_that("resolve_phylopic works with PBDB", {
skip_if_offline(host = "paleobiodb.org")
tryCatch(check_url("https://paleobiodb.org/data1.2/"),
error = function(e) skip())
skip_if_offline(host = "api.phylopic.org")
res <- resolve_phylopic(name = "Velociraptor mongoliensis",
api = "paleobiodb.org")
Expand Down

0 comments on commit 558c3bd

Please sign in to comment.