]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PythonAPI/model/tests/tests.py
Salome HOME
return compsolid, when result is compound of connected solids
[modules/shaper.git] / src / PythonAPI / model / tests / tests.py
index 924ad3405ba97f1f0d1b44b5b23b9ae3cf582c10..23e6844610cc01fe590c56fa1e2d5e371dad0891 100644 (file)
@@ -154,6 +154,20 @@ def testCompound(theFeature, NbSubRes, NbSolid, NbFace, NbEdge, NbVertex):
   testNbUniqueSubShapes(theFeature, GeomAPI_Shape.VERTEX, NbVertex)
 
 
+def testCompSolid(theFeature, NbSubRes, NbSolid, NbFace, NbEdge, NbVertex):
+  """ Tests number of unique sub-shapes in compsolid result
+  """
+  aResults = theFeature.feature().results()
+  aNbResults = len(aResults)
+  assert (aNbResults == 1), "Number of results: {} not equal to 1.".format(aNbResults)
+  assert aResults[0].shape().isCompSolid(), "Result shape type: {}. Expected: COMPSOLID.".format(aResults[0].shape().shapeTypeStr())
+  testNbSubResults(theFeature, NbSubRes)
+  testNbUniqueSubShapes(theFeature, GeomAPI_Shape.SOLID, NbSolid)
+  testNbUniqueSubShapes(theFeature, GeomAPI_Shape.FACE, NbFace)
+  testNbUniqueSubShapes(theFeature, GeomAPI_Shape.EDGE, NbEdge)
+  testNbUniqueSubShapes(theFeature, GeomAPI_Shape.VERTEX, NbVertex)
+
+
 def testResults(theFeature, NbRes, NbSubRes, NbShell, NbFace, NbEdge, NbVertex):
   """ Tests numbers of unique sub-shapes in the results
   """