diff --git a/tests/testthat/test-scopus.R b/tests/testthat/test-scopus.R index 6889b62..385d562 100644 --- a/tests/testthat/test-scopus.R +++ b/tests/testthat/test-scopus.R @@ -1,14 +1,22 @@ test_that("scopus finds single known doi", { - skip_on_cran() - - # Pull single test doi citation from test-citations.csv - test_cit <- get_test_doi("scopus") - - # Search for single test doi using citation_search_springer() function - scopus_res <- - citation_test_doi("scopus") # Need to key API keys in order for this to work - - if (!is.null(scopus_res)) { - expect_true(test_cit$pub_id %in% scopus_res$article_id) - } + skip_on_cran() + + key <- scythe_get_key("scopus") + + if (is.na(key)){ + skip() + message("No Scopus key set. Skipping.") + } + + + # Pull single test doi citation from test-citations.csv + test_cit <- get_test_doi("scopus") + + # Search for single test doi using citation_search_springer() function + scopus_res <- + citation_test_doi("scopus") # Need to key API keys in order for this to work + + if (!is.null(scopus_res)) { + expect_true(test_cit$pub_id %in% scopus_res$article_id) + } }) diff --git a/tests/testthat/test-springer.R b/tests/testthat/test-springer.R index 8d0655f..67fcab7 100644 --- a/tests/testthat/test-springer.R +++ b/tests/testthat/test-springer.R @@ -1,6 +1,13 @@ test_that("springer finds single known doi", { skip_on_cran() + key <- scythe_get_key("springer") + + if (is.na(key)){ + skip() + message("No Springer key set. Skipping.") + } + # Pull single test doi citation from test-citations.csv test_cit <- get_test_doi("springer")