tests/testthat/test-aws_env_vars.R

test_that("check_for_aws_env_vars returns true if credentials set", {
  skip_if_no_aws_credentials()
  expect_true(check_for_aws_env_vars())
})

test_that("check_for_aws_env_vars returns false if credentials unset", {
  withr::with_envvar(new = c(
    "AWS_ACCESS_KEY_ID" = NA,
    "AWS_SECRET_ACCESS_KEY" = NA
  ), {
    expect_false(check_for_aws_env_vars())
  })
})

Try the s3 package in your browser

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

s3 documentation built on Sept. 11, 2024, 7:03 p.m.