Skip to content

Commit

Permalink
update as_epiparameter test to expect error
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlambert committed Sep 25, 2024
1 parent ffb870b commit c3172f4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tests/testthat/test-coercion.R
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,12 @@ test_that("as_epiparameter fails as expected with overwritten prob_dist", {
ebola_params$article_label == "Fallah 2015 (1)"
),
]
# suppress warning and message about citation
ebola_si_lnorm <- suppressWarnings(
suppressMessages(
as_epiparameter(ebola_si, prob_dist = "lnorm")
)
expect_error(
suppressWarnings(
suppressMessages(
as_epiparameter(ebola_si, prob_dist = "lnorm")
)
),
regexp = "Incorrect parameters provided for probability distribution."
)
expect_s3_class(ebola_si_lnorm, class = "epiparameter")
expect_false(is_parameterised(ebola_si_lnorm))
expect_identical(family(ebola_si_lnorm), "lnorm")
})

0 comments on commit c3172f4

Please sign in to comment.