From a22acf3a9b316d352af1d37e5cfe9208b4801666 Mon Sep 17 00:00:00 2001 From: ross hull Date: Tue, 16 Jul 2024 16:10:08 +0100 Subject: [PATCH] change tests to accomodate moving dataset checks to get_latest_resource --- tests/testthat/test-get_latest_resource.R | 7 +++++++ tests/testthat/test-get_latest_resource_id.R | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tests/testthat/test-get_latest_resource.R diff --git a/tests/testthat/test-get_latest_resource.R b/tests/testthat/test-get_latest_resource.R new file mode 100644 index 0000000..6defe90 --- /dev/null +++ b/tests/testthat/test-get_latest_resource.R @@ -0,0 +1,7 @@ +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")) +}) diff --git a/tests/testthat/test-get_latest_resource_id.R b/tests/testthat/test-get_latest_resource_id.R index c2e7569..6defe90 100644 --- a/tests/testthat/test-get_latest_resource_id.R +++ b/tests/testthat/test-get_latest_resource_id.R @@ -1,7 +1,7 @@ test_that("returns data for a dataset that is listed", { - expect_no_error(get_latest_resource_id("gp-practice-populations")) + 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_id("hospital-codes")) + expect_error(get_latest_resource("hospital-codes")) })