Skip to content

Commit ac9f31e

Browse files
committed
test: do not query system keyring on CRAN
1 parent c2287da commit ac9f31e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: openrouteservice
22
Title: An 'openrouteservice' API Client
3-
Version: 0.6.0
3+
Version: 0.6.1
44
Authors@R: c(
55
person("Heidelberg Institute for Geoinformation Technology (HeiGIT) gGmbH", role = "cph"),
66
person(c("Andrzej", "K."), "Oleś", email = "andrzej.oles@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0285-2787"))

tests/testthat/test-api_key.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
context("Key management")
22

3+
on_cran <- function() {
4+
!interactive() && !isTRUE(as.logical(Sys.getenv("NOT_CRAN", "false")))
5+
}
6+
37
## record current state before starting any tests
48
env <- Sys.getenv("ORS_API_KEY", NA);
5-
key <- tryCatch(keyring::key_get("openrouteservice"), error = function(e) NA)
9+
key <- tryCatch(if (on_cran()) NA else keyring::key_get("openrouteservice"), error = function(e) NA)
610

711
## restore initial state
812
on.exit({

0 commit comments

Comments
 (0)