From: mpv Date: Tue, 28 Nov 2017 11:00:58 +0000 (+0300) Subject: Added new python function for tests creation X-Git-Tag: V_2.10.0RC~130 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d3508eea8045ff0a82a23174d230cb0dd7d17fc;p=modules%2Fshaper.git Added new python function for tests creation --- diff --git a/src/PythonAPI/model/tests/tests.py b/src/PythonAPI/model/tests/tests.py index 49fdcdd13..0b49118b2 100644 --- a/src/PythonAPI/model/tests/tests.py +++ b/src/PythonAPI/model/tests/tests.py @@ -266,3 +266,13 @@ def assertSketchArc(theArcFeature): aDistCE = sketcher.tools.distancePointPoint(aCenterPnt, aEndPnt) assert math.fabs(aDistCS - aDistCE) < TOLERANCE, "Wrong arc: center-start distance {}, center-end distance {}".format(aDistCS, aDistCE) assert math.fabs(aRadius.value() -aDistCS) < TOLERANCE, "Wrong arc: radius is {0}, expected {1}".format(aRadius.value(), aDistCS) + +def checkBooleansResult(theFeature,theModel,NbRes,NbSubRes,NbSolid,NbFace,NbEdge,NbVertex): + """ Tests numbers of sub-shapes in results (used in Boolean operations tests) + """ + theModel.testNbResults(theFeature, NbRes) + theModel.testNbSubResults(theFeature,NbSubRes) + theModel.testNbSubShapes(theFeature, GeomAPI_Shape.SOLID, NbSolid ) + theModel.testNbSubShapes(theFeature, GeomAPI_Shape.FACE, NbFace) + theModel.testNbSubShapes(theFeature, GeomAPI_Shape.EDGE, NbEdge) + theModel.testNbSubShapes(theFeature, GeomAPI_Shape.VERTEX, NbVertex)