From: azv Date: Tue, 14 Mar 2017 10:30:10 +0000 (+0300) Subject: Issue #2018: unit test added X-Git-Tag: V_2.7.0~230^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9851e7899fcb82c2a365e6a6caa040ab4dc3b131;p=modules%2Fshaper.git Issue #2018: unit test added --- diff --git a/src/SketchPlugin/Test/Test2018.py b/src/SketchPlugin/Test/Test2018.py new file mode 100644 index 000000000..5ec83eef5 --- /dev/null +++ b/src/SketchPlugin/Test/Test2018.py @@ -0,0 +1,43 @@ +""" + Test2018.py + Test case for issue #2018 "After split auxiliary circle edit of axiliary state of arc is wrong" +""" + +from ModelAPI import ModelAPI_Feature +from SketchAPI import SketchAPI_Arc +from salome.shaper import model + +def getArcs(theSketch): + anArcs = [] + for aSubObj in theSketch.features().list(): + aFeature = ModelAPI_Feature.feature(aSubObj) + if aFeature is not None and aFeature.getKind() == "SketchArc": + anArcs.append(aFeature) + return anArcs + + +model.begin() +partSet = model.moduleDocument() +Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY")) +SketchCircle_1 = Sketch_1.addCircle(-316.2976090885591, -103.0319555403832, 230.3644881376851) +SketchCircle_1.setAuxiliary(True) +SketchLine_1 = Sketch_1.addLine(-489.6131019153831, 48.7229038254136, -457.9545454545454, 334.0909090909091) +SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1]) +SketchLine_2 = Sketch_1.addLine(-457.9545454545454, 334.0909090909091, -251.2069112222553, 117.9454153513332) +SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint()) +SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1]) +Sketch_1.addSplit(SketchCircle_1, SketchLine_1.startPoint(), SketchLine_2.endPoint()) +model.do() + +anArcs = getArcs(Sketch_1) +# check auxiliary flags +for arc in anArcs: + aCurrentArc = SketchAPI_Arc(arc) + assert(aCurrentArc.auxiliary().value()) + aCurrentArc.setAuxiliary(False) + model.do() + assert(aCurrentArc.auxiliary().value() == False) + +model.end() + +assert(model.checkPythonDump())