tests/testthat/test-setup_access_restrictions.R

testthat::test_that("refer_main_password_file", {

  file <- tempfile(fileext = ".htpasswd_private")
  saros.base:::write_htpasswd_file(x=data.frame(username="test", password="test"), file = file)
  if(interactive()) {
    saros.base:::refer_main_password_file(x=file, usernames="test2", append_users = TRUE, password_input = "prompt") |>
    testthat::expect_equal(expected = NULL)


  }
  saros.base:::refer_main_password_file(x=file, usernames="test3", append_users = TRUE, password_input = "12") |>
    testthat::expect_type("character")

})

Try the saros.base package in your browser

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

saros.base documentation built on June 8, 2025, 10:03 a.m.