From fa6c5ca9c2df81c6426ff7ee144dbbe3d73e9d2e Mon Sep 17 00:00:00 2001 From: Rich FitzJohn Date: Tue, 5 Nov 2024 13:15:34 +0000 Subject: [PATCH] Update tests --- tests/testthat/test-combine.R | 7 ++++--- tests/testthat/test-model.R | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-combine.R b/tests/testthat/test-combine.R index fc8f51d7..33b0d005 100644 --- a/tests/testthat/test-combine.R +++ b/tests/testthat/test-combine.R @@ -290,7 +290,8 @@ test_that("can combine models that allow multiple parameters", { test_that("Don't allow multiple parameters where either model lacks support", { - m <- ex_sir_filter_likelihood() + m <- ex_simple_gamma1() + m$properties$allow_multiple_parameters <- FALSE p <- monty_dsl({ beta ~ Gamma(shape = 1, rate = 1 / 0.5) gamma ~ Gamma(shape = 1, rate = 1 / 0.5) @@ -300,10 +301,10 @@ test_that("Don't allow multiple parameters where either model lacks support", { properties <- monty_model_properties(allow_multiple_parameters = FALSE) expect_false( - monty_model_combine(m, p, properties)$allow_multiple_parmeters) + monty_model_combine(m, p, properties)$properties$allow_multiple_parameters) properties <- monty_model_properties(allow_multiple_parameters = NULL) expect_false( - monty_model_combine(m, p, properties)$allow_multiple_parmeters) + monty_model_combine(m, p, properties)$properties$allow_multiple_parameters) properties <- monty_model_properties(allow_multiple_parameters = TRUE) expect_error( monty_model_combine(m, p, properties), diff --git a/tests/testthat/test-model.R b/tests/testthat/test-model.R index 1fe3f3ca..337d6364 100644 --- a/tests/testthat/test-model.R +++ b/tests/testthat/test-model.R @@ -7,7 +7,8 @@ test_that("can create a minimal model", { has_direct_sample = FALSE, is_stochastic = FALSE, has_observer = FALSE, - has_parameter_groups = FALSE)) + has_parameter_groups = FALSE, + allow_multiple_parameters = FALSE)) expect_equal(m$domain, rbind(a = c(-Inf, Inf))) expect_equal(m$parameters, "a") expect_equal(m$density(0), dnorm(0, log = TRUE))