Commit 04141e89 authored by David's avatar David
Browse files

tests(Runmodel.Supervision): missing attributes for GR models

Refs #177
Showing with 16 additions and 12 deletions
+16 -12
......@@ -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"
......
......@@ -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(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment