From 8f444887be96f1a23487c76e623144c9473fa6cb Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 22 Aug 2016 11:47:25 +0300 Subject: [PATCH] Update unit test for changing default color --- src/ModelAPI/Test/TestResults.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ModelAPI/Test/TestResults.py b/src/ModelAPI/Test/TestResults.py index b74b29e7e..b7e928d57 100755 --- a/src/ModelAPI/Test/TestResults.py +++ b/src/ModelAPI/Test/TestResults.py @@ -17,9 +17,17 @@ aSession = ModelAPI_Session.get() #========================================================================= aPartSet = aSession.moduleDocument() aSession.startOperation() -aPlaneX = aPartSet.objectByName("Construction", "YOZ"); +aPlaneX = aPartSet.addFeature("Plane") +aPlaneX.string("creation_method").setValue("by_general_equation") +aPlaneX.real("A").setValue(1.) +aPlaneX.real("B").setValue(0.) +aPlaneX.real("C").setValue(0.) +aPlaneX.real("D").setValue(0.) assert(aPlaneX) -aColors = aPlaneX.data().intArray("Color") +aSession.finishOperation() + +aSession.startOperation() +aColors = aPlaneX.lastResult().data().intArray("Color") assert(aColors) # default colors, not filled array assert(aColors.size() == 0) @@ -31,7 +39,6 @@ assert(aColors.size() == 3) assert(aColors.value(0) == 100) assert(aColors.value(1) == 200) assert(aColors.value(2) == 250) - aSession.finishOperation() import model -- 2.39.2