From 8d19e0591853f0fa5fc6514e1fea93e6443e2c47 Mon Sep 17 00:00:00 2001
From: David <david.dorchies@inrae.fr>
Date: Tue, 28 May 2024 10:53:37 +0200
Subject: [PATCH] test: calibration with sibling a priori node

Refs #156, #157
---
 tests/testthat/test-CreateInputsCrit.R | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/testthat/test-CreateInputsCrit.R b/tests/testthat/test-CreateInputsCrit.R
index 8c3ad5a..980a6aa 100644
--- a/tests/testthat/test-CreateInputsCrit.R
+++ b/tests/testthat/test-CreateInputsCrit.R
@@ -122,6 +122,18 @@ test_that("Lavenne criterion: not upstream a priori nodes are allow if processed
     transfo = "sqrt"
   )
   expect_equal(attr(IC156$`54029`, "AprioriId"), c("54029" = "54095"))
+  e <- runCalibration(
+    nodes = nodes,
+    Qobs2 = NULL,
+    InputsCrit = IC156,
+    CalibOptions = NULL,
+    FUN_CRIT = ErrorCrit_KGE2,
+    runRunModel = FALSE,
+    IsHyst = FALSE
+  )
+  for (x in ls(e)) assign(x, get(x, e))
+  # 54029 not processed as ungauged
+  expect_false(is.null(OutputsCalib$`54029`$CritFinal))
 })
 
 test_that("Lavenne criterion: current node and a priori node must use the same model", {
-- 
GitLab