Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Oct 16, 2023
1 parent ce4b744 commit d93a53e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
1 change: 1 addition & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
library("data.table")
library("lifecycle")

if (identical(Sys.getenv("NOT_CRAN"), "true")) {
files <- c(
Expand Down
20 changes: 2 additions & 18 deletions tests/testthat/test-delays.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ test_that("contradictory delays are caught", {
})

test_that("deprecated arguments are caught", {
options(lifecycle_verbosity = "warning")
expect_warning(
test_stan_delays(
generation_time = generation_time_opts(mean = 3),
Expand Down Expand Up @@ -113,22 +114,5 @@ test_that("deprecated arguments are caught", {
params = delay_params
), "deprecated"
)
expect_warning(
test_stan_delays(
generation_time = generation_time_opts(
get_generation_time(
disease = "SARS-CoV-2", source = "ganyani",
)
),
), "deprecated"
)
expect_warning(
test_stan_delays(
delays = delay_opts(
get_incubation_period(
disease = "SARS-CoV-2", source = "lauer"
)
),
), "deprecated"
)
options(lifecycle_verbosity = NULL)
})
2 changes: 1 addition & 1 deletion tests/testthat/test-report_cases.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ test_that("report_cases can simulate infections forward", {
expect_equal(class(reported_cases), "list")
expect_equal(class(reported_cases$samples), c("data.table", "data.frame"))
expect_equal(class(reported_cases$summarised), c("data.table", "data.frame"))
expect_equal(nrow(reported_cases$summarised), 9)
expect_equal(nrow(reported_cases$summarised), 10)
expect_equal(class(reported_cases$summarised$median), "numeric")
})

0 comments on commit d93a53e

Please sign in to comment.