tests/testthat/test-buildAuthenticationRequest.R

test_that("The URL must be a string", {
  expect_error(
    .buildAuthenticationRequest(
      distillerInstanceUrl = 123,
      distillerKey = "DISTILLER_API_KEY"))
})

test_that("The API key must be a string", {
  expect_error(
    .buildAuthenticationRequest(
      distillerInstanceUrl = "https://example.org",
      distillerKey = 123))
})

test_that("The timeout must be an integer", {
  expect_error(
    .buildAuthenticationRequest(
      distillerInstanceUrl = "https://example.org",
      distillerKey = "DISTILLER_API_KEY",
      timeout = ""))
})

test_that("The result must be a httr2_request", {
  expect_s3_class(
    .buildAuthenticationRequest(
      distillerInstanceUrl = "https://example.org",
      distillerKey = "DISTILLER_API_KEY"),
    "httr2_request")
})

Try the distilleR package in your browser

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

distilleR documentation built on April 24, 2026, 1:07 a.m.