From 39d6fd6bc94e82c6a22f572281f0c303e33bcf90 Mon Sep 17 00:00:00 2001 From: Joshua Lambert Date: Mon, 25 Nov 2024 17:00:42 +0000 Subject: [PATCH] move epiparameter.print tests to test-print.R --- tests/testthat/_snaps/epiparameter.md | 35 --------------------------- tests/testthat/_snaps/print.md | 35 +++++++++++++++++++++++++++ tests/testthat/test-epiparameter.R | 23 ------------------ tests/testthat/test-print.R | 23 ++++++++++++++++++ 4 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 tests/testthat/_snaps/epiparameter.md diff --git a/tests/testthat/_snaps/epiparameter.md b/tests/testthat/_snaps/epiparameter.md deleted file mode 100644 index d704a8ec9..000000000 --- a/tests/testthat/_snaps/epiparameter.md +++ /dev/null @@ -1,35 +0,0 @@ -# epiparameter.print works as expected - - Code - epiparameter(disease = "ebola", epi_name = "incubation", prob_distribution = create_prob_distribution( - prob_distribution = "gamma", prob_distribution_params = c(shape = 1, scale = 1))) - Message - Citation cannot be created as author, year, journal or title is missing - Output - Disease: ebola - Pathogen: NA - Epi Parameter: incubation - Study: (????). "No citation." - Distribution: gamma - Parameters: - shape: 1.000 - scale: 1.000 - ---- - - Code - epiparameter(disease = "ebola", epi_name = "incubation", prob_distribution = create_prob_distribution( - prob_distribution = "gamma", prob_distribution_params = c(shape = 1, scale = 1), - discretise = TRUE)) - Message - Citation cannot be created as author, year, journal or title is missing - Output - Disease: ebola - Pathogen: NA - Epi Parameter: incubation - Study: (????). "No citation." - Distribution: discrete gamma - Parameters: - shape: 1.000 - scale: 1.000 - diff --git a/tests/testthat/_snaps/print.md b/tests/testthat/_snaps/print.md index 61c3488c4..a539931d8 100644 --- a/tests/testthat/_snaps/print.md +++ b/tests/testthat/_snaps/print.md @@ -100,3 +100,38 @@ # i Use `parameter_tbl()` to see a summary table of the parameters. # i Explore database online at: https://epiverse-trace.github.io/epiparameter/articles/database.html +# epiparameter.print works as expected + + Code + epiparameter(disease = "ebola", epi_name = "incubation", prob_distribution = create_prob_distribution( + prob_distribution = "gamma", prob_distribution_params = c(shape = 1, scale = 1))) + Message + Citation cannot be created as author, year, journal or title is missing + Output + Disease: ebola + Pathogen: NA + Epi Parameter: incubation + Study: (????). "No citation." + Distribution: gamma + Parameters: + shape: 1.000 + scale: 1.000 + +--- + + Code + epiparameter(disease = "ebola", epi_name = "incubation", prob_distribution = create_prob_distribution( + prob_distribution = "gamma", prob_distribution_params = c(shape = 1, scale = 1), + discretise = TRUE)) + Message + Citation cannot be created as author, year, journal or title is missing + Output + Disease: ebola + Pathogen: NA + Epi Parameter: incubation + Study: (????). "No citation." + Distribution: discrete gamma + Parameters: + shape: 1.000 + scale: 1.000 + diff --git a/tests/testthat/test-epiparameter.R b/tests/testthat/test-epiparameter.R index 7783cc7a2..69a4baaa3 100644 --- a/tests/testthat/test-epiparameter.R +++ b/tests/testthat/test-epiparameter.R @@ -173,29 +173,6 @@ test_that("epiparameter fails as expected", { ) }) -test_that("epiparameter.print works as expected", { - expect_snapshot(epiparameter( - disease = "ebola", - epi_name = "incubation", - prob_distribution = create_prob_distribution( - prob_distribution = "gamma", - prob_distribution_params = c(shape = 1, scale = 1) - ) - )) -}) - -test_that("epiparameter.print works as expected", { - expect_snapshot(epiparameter( - disease = "ebola", - epi_name = "incubation", - prob_distribution = create_prob_distribution( - prob_distribution = "gamma", - prob_distribution_params = c(shape = 1, scale = 1), - discretise = TRUE - ) - )) -}) - test_that("epiparameter.plot does not produce an error", { ebola_dist <- suppressMessages(epiparameter( disease = "ebola", diff --git a/tests/testthat/test-print.R b/tests/testthat/test-print.R index 026039433..102fb3799 100644 --- a/tests/testthat/test-print.R +++ b/tests/testthat/test-print.R @@ -12,3 +12,26 @@ test_that("epiparameter_db print method works as expected for <= 5