tests/testthat/test-020-redcapConnection-Functionality.R

context("redcapConnection Functionality")

# Look for a yaml config for automated environments
config_file <- file.path("..", paste0(basename(getwd()),".yml"))
API_KEY <-
  if(file.exists(config_file))
  {
    config <- read_yaml(config_file)
    config$redcapAPI$keys$TestRedcapAPI
  } else 
  {
    keyring::key_get('redcapAPI', 'TestRedcapAPI', 'API_KEYs')
  }


test_that("redcapApiConnection can be created",
          expect_class(
            redcapConnection(url = url, token = API_KEY),
            classes = c("redcapApiConnection", "redcapConnection")
          )
)

Try the redcapAPI package in your browser

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

redcapAPI documentation built on Sept. 13, 2023, 1:07 a.m.