tests/testthat/test-get_latest_resource_id.R

test_that("returns data for a dataset that is listed", {
  expect_no_error(get_latest_resource("gp-practice-populations"))
})

test_that("returns error for a dataset that is not listed", {
  expect_error(get_latest_resource("hospital-codes"))
})

Try the phsopendata package in your browser

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

phsopendata documentation built on Sept. 1, 2025, 5:10 p.m.