tests/testthat/test-check-certified-user.R

context("test-chec-certified-user.R")

syn <- attempt_instantiate()
tryCatch(
  attempt_login(syn),
  error = function(e) {
    print(glue::glue("Did not log into Synapse: {e$message}"))
  }
)
Sys.setenv(R_CONFIG_ACTIVE = "testing")

test_that("check_certified_user returns check_pass if certified", {
  skip_if_not(logged_in(syn = syn))

  res <- check_certified_user("3384770", syn)
  expect_true(inherits(res, "check_pass"))
})

test_that("check_certified_user returns check_fail if not certified", {
  skip_if_not(logged_in(syn = syn))

  res <- check_certified_user("3397446", syn)
  expect_true(inherits(res, "check_fail"))
})
Sage-Bionetworks/dccvalidator documentation built on May 7, 2022, 10:32 a.m.