tests/testthat/test-oc_api_ok.R

test_that("oc_api_ok", {
  skip_on_cran()
  skip_if_offline("httpbin.org")

  # API ok
  expect_true(oc_api_ok())

  # not ok
  expect_false(oc_api_ok("https://httpbin.org/status/500"))
})

Try the opencage package in your browser

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

opencage documentation built on Feb. 20, 2021, 1:06 a.m.