From 229527b331ae0ad1137d6a37996f4365e542f0dd Mon Sep 17 00:00:00 2001 From: athowes Date: Mon, 25 Nov 2024 13:52:53 +0000 Subject: [PATCH] Use prep_marginal_obs --- tests/testthat/test-marginal_model.R | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/testthat/test-marginal_model.R b/tests/testthat/test-marginal_model.R index c02820cc2..34085284b 100644 --- a/tests/testthat/test-marginal_model.R +++ b/tests/testthat/test-marginal_model.R @@ -1,7 +1,7 @@ test_that("as_epidist_marginal_model.epidist_linelist_data with default settings an object with the correct classes", { # nolint: line_length_linter. - prep_obs <- as_epidist_marginal_model(sim_obs) - expect_s3_class(prep_obs, "data.frame") - expect_s3_class(prep_obs, "epidist_marginal_model") + prep_marginal_obs <- as_epidist_marginal_model(sim_obs) + expect_s3_class(prep_marginal_obs, "data.frame") + expect_s3_class(prep_marginal_obs, "epidist_marginal_model") }) test_that("as_epidist_marginal_model.epidist_linelist_data when passed incorrect inputs", { # nolint: line_length_linter. @@ -10,10 +10,13 @@ test_that("as_epidist_marginal_model.epidist_linelist_data when passed incorrect }) # Make this data available for other tests -family_lognormal <- epidist_family(prep_obs, family = brms::lognormal()) +family_lognormal <- epidist_family( + prep_marginal_obs, + family = brms::lognormal() +) test_that("is_epidist_marginal_model returns TRUE for correct input", { # nolint: line_length_linter. - expect_true(is_epidist_marginal_model(prep_obs)) + expect_true(is_epidist_marginal_model(prep_marginal_obs)) expect_true({ x <- list() class(x) <- "epidist_marginal_model" @@ -31,12 +34,12 @@ test_that("is_epidist_marginal_model returns FALSE for incorrect input", { # nol }) test_that("assert_epidist.epidist_marginal_model doesn't produce an error for correct input", { # nolint: line_length_linter. - expect_no_error(assert_epidist(prep_obs)) + expect_no_error(assert_epidist(prep_marginal_obs)) }) test_that("assert_epidist.epidist_marginal_model returns FALSE for incorrect input", { # nolint: line_length_linter. expect_error(assert_epidist(list())) - expect_error(assert_epidist(prep_obs[, 1])) + expect_error(assert_epidist(prep_marginal_obs[, 1])) expect_error({ x <- list() class(x) <- "epidist_marginal_model"