Salome HOME
[Code coverage BuildPlugin]: Improve coverage of Filling and SubShapes features
[modules/shaper.git] / src / BuildPlugin / Test / TestFilling_ErrorMsg.py
index 8ec5a724ff4c065315bee6c00ea74b95f6b4682b..23ed7e49c31898a6ec210beefd303928bee45b8e 100644 (file)
@@ -54,9 +54,39 @@ aSession = ModelAPI_Session.get()
 aSession.startOperation()
 aFillingFeature = featureToCompositeFeature(Part_1.feature()).addFeature("Filling")
 aFillingFeature.string("advanced_options").setValue("")
+aFillingFeature.execute()
+assert(aFillingFeature.error() != "")
+aSession.finishOperation()
+
+aSession.startOperation()
 aBaseObjectsList = aFillingFeature.selectionList("base_objects")
 aBaseObjectsList.append("Polyline_1_1/Generated_Edge&Point_1/Point_1", "EDGE")
 aBaseObjectsList.append("Box_1_1/Top", "FACE")
 aFillingFeature.execute()
 assert(aFillingFeature.error() != "")
 aSession.finishOperation()
+
+
+model.begin()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(30, -30, -30, -30)
+SketchLine_2 = Sketch_1.addLine(-30, -30, -30, 30)
+SketchLine_3 = Sketch_1.addLine(-30, 30, 30, 30)
+SketchLine_4 = Sketch_1.addLine(30, 30, 30, -30)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_1.startPoint())
+SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchLine_4.startPoint())
+SketchConstraintHorizontal_1 = Sketch_1.setHorizontal(SketchLine_1.result())
+SketchConstraintVertical_1 = Sketch_1.setVertical(SketchLine_2.result())
+SketchConstraintHorizontal_2 = Sketch_1.setHorizontal(SketchLine_3.result())
+SketchConstraintVertical_2 = Sketch_1.setVertical(SketchLine_4.result())
+model.do()
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", ""), model.selection("EDGE", "Sketch_1/SketchLine_1")], "auto_correct", 1, 1, 0, 0.0001, 0.0001, False)
+assert(Filling_1.feature().error() != "")
+Part_1_doc.removeFeature(Filling_1.feature())
+
+Filling_1 = model.addFilling(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchLine_3"), model.selection("EDGE", "Sketch_1/SketchLine_4"), model.selection("EDGE", "Sketch_1/SketchLine_1")], "auto_correct", 1, 1, 0, 0.0001, 0.0001, False)
+assert(Filling_1.feature().error() != "")
+model.end()