# Test results
assert (len(anEdgeFeature2.results()) == 12)
+# Check Edge feature failed on incorrect input
+aSession.startOperation()
+anEdgeFeature3 = aPart.addFeature("Edge")
+aBaseObjectsList = anEdgeFeature3.selectionList("base_objects")
+aBaseObjectsList.append(aSketchResult, None)
+aSession.finishOperation()
+assert (len(anEdgeFeature3.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aBoxShape, GeomAPI_Shape.VERTEX)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aBoxResult, aShape)
+aSession.finishOperation()
+assert (len(anEdgeFeature3.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aBoxShape, GeomAPI_Shape.FACE)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aBoxResult, aShape)
+aSession.finishOperation()
+assert (len(anEdgeFeature3.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(anEdgeFeature3)
+aSession.finishOperation()
+
from salome.shaper import model
assert(model.checkPythonDump())
aPart.removeFeature(aFaceFeature4)
aSession.finishOperation()
+# =============================================================================
+# Test 5. Check Face feature failed on incorrect input
+# =============================================================================
+
+aSession.startOperation()
+aFaceFeature5 = aPart.addFeature("Face")
+aBaseObjectsList = aFaceFeature5.selectionList("base_objects")
+aBaseObjectsList.append(aCylinderResult, None)
+aSession.finishOperation()
+assert (len(aFaceFeature5.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aCylinderShape, GeomAPI_Shape.VERTEX)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aCylinderResult, aShape)
+aSession.finishOperation()
+assert (len(aFaceFeature5.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aFaceFeature.lastResult().shape(), GeomAPI_Shape.EDGE)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aFaceFeature.lastResult(), aShape)
+aSession.finishOperation()
+assert (len(aFaceFeature5.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(aFaceFeature5)
+aSession.finishOperation()
+
from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aShellFeature2.results()) > 0)
+# Check Shell feature failed on incorrect input
+aShellResult = aShellFeature.firstResult()
+aSession.startOperation()
+aShellFeature3 = aPart.addFeature("Shell")
+aBaseObjectsList = aShellFeature3.selectionList("base_objects")
+aShapeExplorer = GeomAPI_ShapeExplorer(aShellResult.shape(), GeomAPI_Shape.EDGE)
+while aShapeExplorer.more():
+ aBaseObjectsList.append(aShellResult, aShapeExplorer.current())
+ aShapeExplorer.next()
+aSession.finishOperation()
+assert (len(aShellFeature3.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(aShellFeature3)
+aSession.finishOperation()
+
from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aVertexFeature.results()) == aNumOfPoints)
+# Check Vertex feature failed on incorrect input
+aSession.startOperation()
+aVertexFeature2 = aPart.addFeature("Vertex")
+aBaseObjectsList = aVertexFeature2.selectionList("base_objects")
+aBaseObjectsList.append(aSketchResult, None)
+aSession.finishOperation()
+assert (len(aVertexFeature2.results()) == 0)
+
+aSession.startOperation()
+aLine = aSketchFeature.addFeature("SketchLine")
+geomDataAPI_Point2D(aLine.attribute("StartPoint")).setValue(0, 0)
+geomDataAPI_Point2D(aLine.attribute("EndPoint")).setValue(100, 100)
+aSession.finishOperation()
+aSession.startOperation()
+aBaseObjectsList.clear()
+aBaseObjectsList.append(aSketchResult, aLine.lastResult().shape())
+aSession.finishOperation()
+assert (len(aVertexFeature2.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(aVertexFeature2)
+aPart.setCurrentFeature(aVertexFeature, True)
+aSession.finishOperation()
+
from salome.shaper import model
assert(model.checkPythonDump())
# Test results
assert (len(aWireFeature2.results()) == 1)
+# =============================================================================
+# Test 4. Check Wire feature failed on incorrect input
+# =============================================================================
+
+aSession.startOperation()
+aWireFeature3 = aPart.addFeature("Wire")
+aBaseObjectsList = aWireFeature3.selectionList("base_objects")
+aBaseObjectsList.append(aSketchResult, None)
+aSession.finishOperation()
+assert (len(aWireFeature3.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aBoxShape, GeomAPI_Shape.VERTEX)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aBoxResult, aShape)
+aSession.finishOperation()
+assert (len(aWireFeature3.results()) == 0)
+
+aSession.startOperation()
+aBaseObjectsList.clear()
+aShapeExplorer = GeomAPI_ShapeExplorer(aBoxShape, GeomAPI_Shape.FACE)
+aShape = aShapeExplorer.current()
+aBaseObjectsList.append(aBoxResult, aShape)
+aSession.finishOperation()
+assert (len(aWireFeature3.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(aWireFeature3)
+aSession.finishOperation()
+
assert(model.checkPythonDump())