diff --git a/tests/testthat/test-RunModel.R b/tests/testthat/test-RunModel.R index db0a5221ac69d9ba973a3ff0d15a15ec63311ce8..971a86f33ce9f0fa83fbc7bdca86a8b4bf87bff2 100644 --- a/tests/testthat/test-RunModel.R +++ b/tests/testthat/test-RunModel.R @@ -32,18 +32,6 @@ test_that("RunModel.GRiwrmInputsModel should return same result with separated w }) }) -test_that("RunModel.Supervisor with no regulation should returns same results as RunModel.GRiwrmInputsModel", { - sv <- CreateSupervisor(InputsModel) - OM_Supervisor <- RunModel( - sv, - RunOptions = RunOptions, - Param = ParamMichel - ) - lapply(griwrm$id, function(id) { - expect_equal(OM_Supervisor[[!!id]]$Qsim, OM_GriwrmInputs[[!!id]]$Qsim) - }) -}) - test_that("RunModel.GRiwrmInputsModel handles CemaNeige", { l <- setUpCemaNeigeData() l$griwrm[l$griwrm$id == "Down", "model"] <- "RunModel_GR4J" diff --git a/tests/testthat/test-RunModel.Supervisor.R b/tests/testthat/test-RunModel.Supervisor.R index 07c2e55f2bcf2b026c8be27a4186e3f7ce23fdc2..3fae05cff080628a4ccc2f6ea905eda0abcfe1c4 100644 --- a/tests/testthat/test-RunModel.Supervisor.R +++ b/tests/testthat/test-RunModel.Supervisor.R @@ -6,6 +6,22 @@ e <- setupRunModel() # https://stackoverflow.com/questions/9965577/r-copy-move-one-environment-to-another for(x in ls(e)) assign(x, get(x, e)) +test_that("RunModel.Supervisor with no regulation should returns same results as RunModel.GRiwrmInputsModel", { + sv <- CreateSupervisor(InputsModel) + OM_Supervisor <- RunModel( + sv, + RunOptions = RunOptions, + Param = ParamMichel + ) + lapply(griwrm$id, function(id) { + expect_equal(sort(names(OM_GriwrmInputs[[!!id]])), + sort(names(OM_Supervisor[[!!id]]))) + lapply(names(OM_Supervisor[[id]]), function(x) { + expect_equal(OM_Supervisor[[!!id]][[!!x]], OM_GriwrmInputs[[!!id]][[!!x]]) + }) + }) |> invisible() +}) + # Add 2 nodes to the network nodes2 <- rbind(nodes, data.frame(