From 5d3508eea8045ff0a82a23174d230cb0dd7d17fc Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 28 Nov 2017 14:00:58 +0300 Subject: [PATCH] Added new python function for tests creation --- src/PythonAPI/model/tests/tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- 2.30.2