Skip to content

Commit

Permalink
Fix test to handle NYD
Browse files Browse the repository at this point in the history
  • Loading branch information
MansMeg committed Sep 10, 2023
1 parent 37734bd commit 186f265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RPackage/tests/testthat/test-polls_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 186f265

Please sign in to comment.