tests/testthat/test-providers.R

context("providers")

test_that("update_providers", {
  skip_on_cran()

  library("httr")

  # call would take too long, mocking
  expect_error(update_providers(config = timeout(0.001)),
               "Timeout was reached")
})

test_that("load_providers", {
  # delete providers
  stuff <- providers
  expect_is(stuff, "data.frame")
  rm(stuff)
  expect_error(get("stuff"))
})

test_that("providers data set", {
  expect_is(providers, "data.frame")
  expect_lt(2500, NROW(providers))
})
ropensci/oai documentation built on Nov. 18, 2022, 5:33 p.m.