tests/testthat/test_http_error.R

message("\nTesting handling of HTTP errors")

test_that("Error for invalid endpoint", {
  skip_on_cran()
  response <- get_response("/fakeEndpoint", query = list(format = "json", api_key = get_api_key()))
  expect_error(process_json_response(response), "\\[404\\]: [a-zA-Z0-9:/.]+fakeEndpoint")
})

Try the TCIApathfinder package in your browser

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

TCIApathfinder documentation built on Sept. 21, 2019, 5:03 p.m.