Salome HOME
Rename checkBooleansResult to checkResult.
[modules/shaper.git] / src / PythonAPI / model / tests / tests.py
index ff7ce4dddedba4ee5d7a50b337c0b9d754370673..7cd30c2caa43552c4f5989e5430070f6734a9da9 100644 (file)
@@ -226,15 +226,19 @@ def testHaveNamingByType(theFeature, theModel, thePartDoc, theSubshapeType) :
     shapeExplorer = GeomAPI_ShapeExplorer(shape, theSubshapeType)
     # Create list, and store selections in it
     while shapeExplorer.more():
+      current = shapeExplorer.current()
+      if current.isEdge() and GeomAPI.GeomAPI_Edge(current).isDegenerated(): # skip degenerative edges because they are not selected
+        shapeExplorer.next()
+        continue
       aDuplicate = False
       for alreadyThere in shapesList:
-        if alreadyThere.isSame(shapeExplorer.current()):
+        if alreadyThere.isSame(current):
           aDuplicate = True
       if aDuplicate:
         shapeExplorer.next()
         continue
-      shapesList.append(shapeExplorer.current())
-      selection = theModel.selection(aResult, shapeExplorer.current()) # First argument should be result/sub-result, second is sub-shape on this result/sub-result
+      shapesList.append(current)
+      selection = theModel.selection(aResult, current) # First argument should be result/sub-result, second is sub-shape on this result/sub-result
       selectionList.append(selection)
       shapeExplorer.next()
   # Create group with this selection list
@@ -283,8 +287,8 @@ def assertSketchArc(theArcFeature):
   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)
+def checkResult(theFeature,theModel,NbRes,NbSubRes,NbSolid,NbFace,NbEdge,NbVertex):
+  """ Tests numbers of sub-shapes in results
   """
   theModel.testNbResults(theFeature, NbRes)
   theModel.testNbSubResults(theFeature, NbSubRes)