From 186f265589626096fe15293e48dd4b86e0cdf679 Mon Sep 17 00:00:00 2001 From: Mans Magnusson Date: Sun, 10 Sep 2023 21:34:56 +0200 Subject: [PATCH] Fix test to handle NYD --- RPackage/tests/testthat/test-polls_data.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RPackage/tests/testthat/test-polls_data.R b/RPackage/tests/testthat/test-polls_data.R index 05409f7..9af492e 100644 --- a/RPackage/tests/testthat/test-polls_data.R +++ b/RPackage/tests/testthat/test-polls_data.R @@ -20,8 +20,8 @@ test_that(desc="get_polls()",{ # Test consistency incorrect_polls <- dat$PublYearMonth == "2012-jun" & dat$Company == "YouGov" - checkmate::expect_numeric(rowSums(dat[!incorrect_polls, 3:11], na.rm = TRUE), lower = 93.2, upper = 100, info = "Parties do not sum to 93.2 < x < 100") - checkmate::expect_numeric(rowSums(dat[1:100, 3:11], na.rm = TRUE), lower = 93.2, upper = 100, info = "Parties do not sum to 93.2 < x < 100") + checkmate::expect_numeric(rowSums(dat[!incorrect_polls, 3:11], na.rm = TRUE), lower = 89.7, upper = 100, info = "Parties do not sum to 89.7 < x < 100") + checkmate::expect_numeric(rowSums(dat[1:100, 3:11], na.rm = TRUE), lower = 89.7, upper = 100, info = "Parties do not sum to 89.7 < x < 100") checkmate::expect_integerish(dat$n, lower = 500) expect_true(all(dat$collectPeriodFrom <= dat$collectPeriodTo, na.rm = TRUE), info = "collectPeriodFrom > dat$collectPeriodTo")