Commit 1835bfeb authored by Dorchies David's avatar Dorchies David
Browse files

tests: handle warnings in CreateInputsModel

parent 4a219999
......@@ -41,7 +41,7 @@ setupRunModel <- function() {
)
# set up inputs
InputsModel <- CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs)
InputsModel <- suppressWarnings(CreateInputsModel(griwrm, DatesR, Precip, PotEvap, Qobs))
# RunOptions
nTS <- 365
......
......@@ -3,14 +3,16 @@ context("CreateInputsModel")
l <- setUpCemaNeigeData()
test_that("CemaNeige data should be in InputsModel", {
InputsModels <- CreateInputsModel(l$griwrm,
DatesR = l$DatesR,
Precip = l$Precip,
PotEvap = l$PotEvap,
TempMean = l$TempMean,
ZInputs = l$ZInputs,
HypsoData = l$HypsoData,
Qobs = l$Qobs)
InputsModels <- suppressWarnings(
CreateInputsModel(l$griwrm,
DatesR = l$DatesR,
Precip = l$Precip,
PotEvap = l$PotEvap,
TempMean = l$TempMean,
ZInputs = l$ZInputs,
HypsoData = l$HypsoData,
Qobs = l$Qobs)
)
l$DatesR <- as.data.frame(l$DatesR)
lapply(InputsModels, function(IM) {
lapply(c("DatesR", "Precip", "PotEvap"), function(varName) {
......@@ -40,14 +42,16 @@ test_that("handles mix of with and without CemaNeige nodes", {
l$ZInputs <- l$ZInputs[1:2]
l$TempMean <- l$TempMean[,1:2]
l$HypsoData <- l$HypsoData[,1:2]
InputsModels <- CreateInputsModel(l$griwrm,
DatesR = l$DatesR,
Precip = l$Precip,
PotEvap = l$PotEvap,
TempMean = l$TempMean,
ZInputs = l$ZInputs,
HypsoData = l$HypsoData,
Qobs = l$Qobs)
InputsModels <- suppressWarnings(
CreateInputsModel(l$griwrm,
DatesR = l$DatesR,
Precip = l$Precip,
PotEvap = l$PotEvap,
TempMean = l$TempMean,
ZInputs = l$ZInputs,
HypsoData = l$HypsoData,
Qobs = l$Qobs)
)
expect_false(inherits(InputsModels$Down, "CemaNeige"))
expect_null(InputsModels$Down$LayerPrecip)
})
......
Markdown is supported
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