mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 07:30:20 -05:00
Build, copy and edit taskmaestro workflows in ResInsight and save them as standard workflow.yaml + input.yaml. - Python helper: catalog, load, save and export-registered subcommands, and run --registered for installed workflows - C++ definition model with pure edit operations, port type checks, config field derivation, static validation and undo/redo - Installed folder listing registered workflows (read-only, runnable, can be duplicated) - Graph editor dock with task palette, drag-to-connect, context menus, automatic layout and debounced live validation - New/Duplicate/Save/Save As/Rescan commands; unsaved edits run from a temporary folder and prompt before being discarded - Update the design document and the user README
35 lines
1.4 KiB
C++
35 lines
1.4 KiB
C++
#include "gtest/gtest.h"
|
|
|
|
#include "RimWorkflowVec3Binding.h"
|
|
|
|
#include <QJsonObject>
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
/// taskmaestro_resinsight.models.Vec3 is a plain pydantic model with x/y/z number fields, so both
|
|
/// the schema default and config_values represent it as a JSON object, not an array.
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RimWorkflowVec3Binding, AppliesObjectDefault )
|
|
{
|
|
RimWorkflowVec3Binding binding;
|
|
|
|
const QJsonObject schema{ { "name", "reference_point" },
|
|
{ "description", "Reference point" },
|
|
{ "required", true },
|
|
{ "default", QJsonObject{ { "x", 457196.0 }, { "y", 7322270.0 }, { "z", 2742.0 } } } };
|
|
binding.applySchema( schema );
|
|
|
|
const QJsonObject expected{ { "x", 457196.0 }, { "y", 7322270.0 }, { "z", 2742.0 } };
|
|
EXPECT_EQ( QJsonValue( expected ), binding.toJsonValue() );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
TEST( RimWorkflowVec3Binding, NoDefaultYieldsNull )
|
|
{
|
|
RimWorkflowVec3Binding binding;
|
|
|
|
const QJsonObject schema{ { "name", "reference_point" }, { "required", true } };
|
|
binding.applySchema( schema );
|
|
|
|
EXPECT_TRUE( binding.toJsonValue().isNull() );
|
|
}
|