diff --git a/core/test/utils_test.jl b/core/test/utils_test.jl index 6c23e7558..92e3dd974 100644 --- a/core/test/utils_test.jl +++ b/core/test/utils_test.jl @@ -299,3 +299,21 @@ end 2.0, ) === 1.0 end + +@testitem "constrains_from_nodes" begin + toml_path = normpath(@__DIR__, "../../generated_testmodels/basic/ribasim.toml") + @test ispath(toml_path) + model = Ribasim.BMI.initialize(Ribasim.Model, toml_path) + (; p) = model.integrator + constraining_types = (:pump, :outlet, :linear_resistance) + + for type in Ribasim.nodefields(p) + node = getfield(p, type) + println(node) + if type in constraining_types + @test Ribasim.is_flow_constraining(node) + else + @test !Ribasim.is_flow_constraining(node) + end + end +end