Salome HOME
Added new python function for tests creation
[modules/shaper.git] / src / PythonAPI / model / tests / tests.py
index 49fdcdd1306ebc165b4a42158f609de2001c8357..0b49118b289a8eef36e4d72ecc3c90c74508489f 100644 (file)
@@ -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)