tests/testthat/test-vb_basereq.R

test_that("vb_basereq defaults work", {
  br <- vb_basereq()
  expect_s3_class(br, "httr2_request")
  expect_equal(br$url, "https://vectorbyte.crc.nd.edu/portal/api/")
  expect_equal(br$options$useragent, "ROHVBD")
})

test_that("vb_basereq arguments work", {
  br <- vb_basereq("url", "agent")
  expect_equal(br$url, "url")
  expect_equal(br$options$useragent, "agent")
})

test_that("vb_basereq qa switch works", {
  expect_equal(vb_basereq(.qa = TRUE)$url, "https://vectorbyte-qa.crc.nd.edu/portal/api/")
})

test_that("vb_basereq ssl verification switch works", {
  expect_null(vb_basereq()$options$ssl_verifypeer)
  expect_equal(vb_basereq(unsafe = TRUE)$options$ssl_verifypeer, 0)
})

Try the ohvbd package in your browser

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

ohvbd documentation built on March 10, 2026, 1:07 a.m.