Skip to content

Commit

Permalink
skip scopus and springer tests if no key is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanetteclark committed Sep 6, 2024
1 parent 1a44a8a commit e524968
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
32 changes: 20 additions & 12 deletions tests/testthat/test-scopus.R
Original file line number Diff line number Diff line change
@@ -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)
}
})
7 changes: 7 additions & 0 deletions tests/testthat/test-springer.R
Original file line number Diff line number Diff line change
@@ -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")

Expand Down

0 comments on commit e524968

Please sign in to comment.