From: Clarisse Genrault Date: Wed, 4 Jan 2017 13:26:04 +0000 (+0100) Subject: Merge branch 'master' into cgt/devCEA X-Git-Tag: V_2.7.0~351 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5b6031b015602aa07f5a6fc668c13ac3faf7a8a9;p=modules%2Fshaper.git Merge branch 'master' into cgt/devCEA --- 5b6031b015602aa07f5a6fc668c13ac3faf7a8a9 diff --cc src/FeaturesAPI/Test/APIParam_Translation.py index f5ad81dce,a24515ae6..85657d32f --- a/src/FeaturesAPI/Test/APIParam_Translation.py +++ b/src/FeaturesAPI/Test/APIParam_Translation.py @@@ -40,4 -40,4 +40,4 @@@ aPoint1 = model.addPoint(aDocument, 0, aPoint2 = model.addPoint(aDocument, 10, 10, 0).result() aTranslation3 = model.addTranslation(aDocument, [model.selection("SOLID", "Box_1_1")], aPoint1, aPoint2).result() aSession.finishOperation() - assert (aTranslation3 is not None) -assert (aTranslation2 is not None) ++assert (aTranslation3 is not None) diff --cc src/PrimitivesAPI/Test/TestBox.py index 3caff58e0,000000000..08b2d9f27 mode 100644,000000..100644 --- a/src/PrimitivesAPI/Test/TestBox.py +++ b/src/PrimitivesAPI/Test/TestBox.py @@@ -1,53 -1,0 +1,53 @@@ +""" +Test case for Primitive Box feature. +Written on High API. +""" +from ModelAPI import * +from GeomAPI import * + - import model ++from salome.shaper import model + +# Get session +aSession = ModelAPI_Session.get() + +# Create a part +aDocument = aSession.activeDocument() +aSession.startOperation() +model.addPart(aDocument) +aDocument = aSession.activeDocument() +aSession.finishOperation() + +# Create a box with dimensions +aSession.startOperation() +aBox1 = model.addBox(aDocument, 10, 10, 10).result() +aSession.finishOperation() +assert (aBox1 is not None) + +# Create a first point +aSession.startOperation() +aFirstPoint = model.addPoint(aDocument, 0, 0, 0).result() +aSession.finishOperation() + +# Create a second point +aSession.startOperation() +aSecondPoint = model.addPoint(aDocument, 50, 50, 50).result() +aSession.finishOperation() + +# Create a box with 2 points +aSession.startOperation() +aBox2 = model.addBox(aDocument, aFirstPoint, aSecondPoint).result() +aSession.finishOperation() +assert (aBox2 is not None) + +# Create a box with dimensions (error) +aSession.startOperation() +aBox3 = model.addBox(aDocument, -10, 10, 10).result() +aSession.finishOperation() +assert (aBox3 is not None) + +# Create a box with 2 points (error) +aSession.startOperation() +aBox4 = model.addBox(aDocument, aFirstPoint, aFirstPoint).result() +aSession.finishOperation() +assert (aBox4 is not None) +