-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I'm using a simple helper to check if i'm logged in to RT or not for unit testing in https://github.com/NCEAS/awards-bot. It's useful for skipping unit tests when not logged in to RT.
It might make more sense for it (or a more elegant version) to live here. Thoughts?
check_rt_login <- function(rt_base) {
base_api <- paste(stringr::str_replace(rt_base, "\\/$", ""),
"REST", "1.0", sep = "/")
content <- httr::GET(base_api) %>%
httr::content()
if (stringr::str_detect(content, "Credentials required")) {
return(FALSE)
} else {
return(TRUE)
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request