tests/testthat/setup-scihub_creds.R

if (full_tests) {

# Retrieve Travis credentials
tests_apihub <- try(sen2r::read_scihub_login(), silent = TRUE)

if (!inherits(tests_apihub, "try-error")) {
  
  # Use a temporary apihub file
  write_scihub_login(
    tests_apihub[1], tests_apihub[2],
    tests_apihub_path <- tempfile(),
    check = FALSE
  )
  
  # Return message
  message("Tests are run with SciHub user \"",tests_apihub[1],"\".")
  
} else {
  message("Problems with SciHub credentials; check secrets.")
}

}

Try the sen2r package in your browser

Any scripts or data that you put into this service are public.

sen2r documentation built on Nov. 10, 2023, 9:08 a.m.