From: azv Date: Sat, 3 Nov 2018 11:33:26 +0000 (+0300) Subject: Update unit tests for ExchangePlugin module X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5b6a5439c6e4aabca035e707f5f38676035d5a62;p=modules%2Fshaper.git Update unit tests for ExchangePlugin module --- diff --git a/src/ExchangePlugin/Test/Test2459.py b/src/ExchangePlugin/Test/Test2459.py index 9cd57811e..a08d419ee 100644 --- a/src/ExchangePlugin/Test/Test2459.py +++ b/src/ExchangePlugin/Test/Test2459.py @@ -109,7 +109,7 @@ SketchConstraintCoincidence_16 = Sketch_1.setCoincident(SketchArc_15.endPoint(), SketchConstraintCoincidence_17 = Sketch_1.setCoincident(SketchArc_15.startPoint(), SketchAPI_Arc(SketchArc_12).startPoint()) SketchConstraintCoincidence_18 = Sketch_1.setCoincident(SketchArc_3.endPoint(), SketchAPI_Arc(SketchArc_6).endPoint()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchArc_1_2f-SketchArc_2_2f-SketchArc_3_2f-SketchArc_4_2r-SketchArc_5_2r-SketchCircle_1_2r-SketchArc_6_2r-SketchArc_7_2r-SketchLine_6f-SketchLine_7f-SketchArc_8_2f-SketchArc_9_2f-SketchLine_8f-SketchLine_9f-SketchArc_10_2f-SketchArc_11_2f-SketchLine_10f-SketchLine_11f-SketchArc_12_2r-SketchArc_13_2r-SketchCircle_2_2r-SketchCircle_3_2r-SketchArc_14_2f-SketchArc_15_2f")], model.selection(), 10, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_2f-SketchArc_1_2f-SketchLine_3f-SketchArc_2_2f-SketchLine_4f-SketchArc_5_2r-SketchArc_3_2f-SketchArc_6_2r-SketchLine_6f-SketchArc_8_2f-SketchLine_8f-SketchArc_10_2f-SketchLine_10f-SketchArc_12_2r-SketchArc_15_2f-SketchArc_7_2r-SketchLine_7f-SketchArc_9_2f-SketchLine_9f-SketchArc_11_2f-SketchLine_11f-SketchArc_13_2r-SketchArc_14_2f-SketchArc_4_2r-SketchCircle_1_2r-SketchCircle_2_2r-SketchCircle_3_2r")], model.selection(), 10, 0) model.do() model.end() diff --git a/src/ExchangePlugin/Test/TestExport.py b/src/ExchangePlugin/Test/TestExport.py index 8a6f1e320..468cee23e 100644 --- a/src/ExchangePlugin/Test/TestExport.py +++ b/src/ExchangePlugin/Test/TestExport.py @@ -108,16 +108,16 @@ def testExportXAO(theFile): aGroupFeature.data().setName("") aSelectionListAttr = aGroupFeature.selectionList("group_list") aSelectionListAttr.setSelectionType("face") - aSelectionListAttr.append("box1_1/Shape1") - aSelectionListAttr.append("box1_1/Shape2") + aSelectionListAttr.append("box1_1/Shape_1") + aSelectionListAttr.append("box1_1/Shape_2") aSession.finishOperation() aSession.startOperation("Create a field") aField = aSession.activeDocument().addFeature("Field") aSelectionListAttr = aField.selectionList("selected") aSelectionListAttr.setSelectionType("face") - aSelectionListAttr.append("box1_1/Shape1") - aSelectionListAttr.append("box1_1/Shape2") + aSelectionListAttr.append("box1_1/Shape_1") + aSelectionListAttr.append("box1_1/Shape_2") aComponentNames = aField.stringArray("components_names") aComponentNames.setSize(2) # two components aComponentNames.setValue(0, "temperatue") diff --git a/src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py b/src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py index 40e9e8088..d5555653e 100644 --- a/src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py +++ b/src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py @@ -39,14 +39,14 @@ SketchConstraintParallel_1 = Sketch_1.setParallel(SketchLine_1.result(), SketchL SketchConstraintParallel_2 = Sketch_1.setParallel(SketchLine_2.result(), SketchLine_4.result()) SketchConstraintPerpendicular_1 = Sketch_1.setPerpendicular(SketchLine_1.result(), SketchLine_4.result()) model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r")], model.selection(), 50, 0) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection(), 50, 0) # Create a group with the faces of the box -Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")] +Group_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) Group_1.setName("Group_faces") Group_1.result().setName("Group_faces") # Create a field on the box -Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_2"), model.selection("FACE", "Extrusion_1_1/From_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face_3")] +Field_1_objects = [model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2"), model.selection("FACE", "Extrusion_1_1/From_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4"), model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3")] Field_1 = model.addField(Part_1_doc, 1, "DOUBLE", 1, ["Comp 1"], Field_1_objects) Field_1.addStep(0, 0, [[0], [1], [2], [3], [4], [5], [6]]) # Create a plane to split the box in two parts diff --git a/src/ExchangePlugin/Test/TestImport.py b/src/ExchangePlugin/Test/TestImport.py index 0d42f9207..e32246013 100644 --- a/src/ExchangePlugin/Test/TestImport.py +++ b/src/ExchangePlugin/Test/TestImport.py @@ -112,9 +112,8 @@ def testImportXAO(): aSelectionList = aFeature2.selectionList("group_list") assert aSelectionList.selectionType() == "face" assert aSelectionList.size() == 2 - assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape1" - print(aSelectionList.value(1).namingName("")) - assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape2" + assert aSelectionList.value(0).namingName("") == "mygeom_1/Shape_1" + assert aSelectionList.value(1).namingName("") == "mygeom_1/Shape_2" aFeature3 = aCompositeFeature.subFeature(2, False) assert aFeature3.getKind() == "Field"