tests/testthat/test-credentials.R

test_that("error on empty API key", {
  expect_error(set_os_key())
  expect_error(set_os_key(''))
  expect_error(set_os_key(NULL))
})

test_that("error on invalid API keys", {
  expect_error(set_os_key(c('a', 'b')))
})

Try the osdatahub package in your browser

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

osdatahub documentation built on April 11, 2025, 5:52 p.m.