]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update unit tests for ExchangePlugin module
authorazv <azv@opencascade.com>
Sat, 3 Nov 2018 11:33:26 +0000 (14:33 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/ExchangePlugin/Test/Test2459.py
src/ExchangePlugin/Test/TestExport.py
src/ExchangePlugin/Test/TestExportToXAOWithGroupNotUpdated.py
src/ExchangePlugin/Test/TestImport.py

index 9cd57811e0372a40026adfbfb8fae57ccc382420..a08d419eec40137a5e90de6904fbe1df4f231ad6 100644 (file)
@@ -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()
 
index 8a6f1e320eceb40448228fe50d0d0c27ec3085b4..468cee23ea1dd7623b4ed46efaa18f410cc30539 100644 (file)
@@ -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")
index 40e9e80889cddcea3366352041edbf69e586eec4..d5555653eed19ccabe06fe9fc7637ef8de14bed8 100644 (file)
@@ -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
index 0d42f92072977e94f3994665b252aa4c08efe7fa..e32246013288db99bbb8274313e1cda5405196d3 100644 (file)
@@ -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"