tests/testthat/test-authentication.R

test_that("authentication works", {
  # Input checks
  expect_error(set_key(1))

  # Test set and unset API key
  set_key("apiKey")
  expect_equal(Sys.getenv("HERE_API_KEY"), "apiKey")
  unset_key()
  expect_equal(Sys.getenv("HERE_API_KEY"), "")
})

Try the hereR package in your browser

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

hereR documentation built on Sept. 18, 2023, 5:21 p.m.