Salome HOME
Make tests working on new results structure and selection of feature as argument
[modules/shaper.git] / test.API / SHAPER / Transformations / TestTranslation_3.py
index 1257473e604c50e3f0c0bf5e83aa2bd0e497c7cb..bf8617124fa8aded48247d0aab88f09e69899a64 100644 (file)
@@ -1,5 +1,25 @@
+## Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+##
+## This library is free software; you can redistribute it and/or
+## modify it under the terms of the GNU Lesser General Public
+## License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+##
+## This library is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this library; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+## See http:##www.salome-platform.org/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
 """
-Test case for Translation feature. 
+Test case for Translation feature.
 Written on High API.
 """
 from salome.shaper import model
@@ -142,14 +162,37 @@ Face_13 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_7/Wire-Sket
 
 # Shells
 Shell_1 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
-Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
-Shell_3 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
-Shell_4 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
-Shell_5 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
+Shell_1.result().setName("Shell_1_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_1_1"), model.selection("FACE", "Recover_2_1")])
+Shell_2.result().setName("Shell_2_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_3 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_3_1"), model.selection("FACE", "Recover_4_1")])
+Shell_3.result().setName("Shell_3_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_4 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_5_1"), model.selection("FACE", "Recover_6_1")])
+Shell_4.result().setName("Shell_4_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_5 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_7_1"), model.selection("FACE", "Recover_8_1")])
+Shell_5.result().setName("Shell_5_1")
 Shell_6 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
-Shell_7 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_12_1"), model.selection("FACE", "Face_13_1")])
-Shell_8 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
-Shell_9 = model.addShell(Part_1_doc, [model.selection("FACE", "Face_10_1"), model.selection("FACE", "Face_11_1")])
+Shell_6.result().setName("Shell_6_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_12.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_13.result()])
+Shell_7 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_9_1"), model.selection("FACE", "Recover_10_1")])
+Shell_7.result().setName("Shell_7_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_8 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_11_1"), model.selection("FACE", "Recover_12_1")])
+Shell_8.result().setName("Shell_8_1")
+model.addRecover(Part_1_doc, Shell_1, [Face_10.result()])
+model.addRecover(Part_1_doc, Shell_1, [Face_11.result()])
+Shell_9 = model.addShell(Part_1_doc, [model.selection("FACE", "Recover_13_1"), model.selection("FACE", "Recover_14_1")])
+Shell_9.result().setName("Shell_9_1")
 
 # Parameters
 model.addParameter(Part_1_doc, "d", "15")
@@ -487,16 +530,16 @@ model.testHaveNamingFaces(Translation_90, model, Part_1_doc)
 
 
 model.testNbResults(Translation_48, 0)
-assert(Translation_48.feature().error() == 'Attribute "axis_object" is not initialized.')
+assert(Translation_48.feature().error() == 'Translation axis is not selected.')
 
 model.testNbResults(Translation_57, 0)
-assert(Translation_57.feature().error() == 'Attribute "axis_object" is not initialized.')
+assert(Translation_57.feature().error() == 'Translation axis is not selected.')
 
 model.testNbResults(Translation_66, 0)
-assert(Translation_66.feature().error() == 'Attribute "axis_object" is not initialized.')
+assert(Translation_66.feature().error() == 'Translation axis is not selected.')
 
 model.testNbResults(Translation_75, 0)
-assert(Translation_75.feature().error() == 'Attribute "axis_object" is not initialized.')
+assert(Translation_75.feature().error() == 'Translation axis is not selected.')
 
 model.testNbResults(Translation_84, 0)
-assert(Translation_84.feature().error() == 'Attribute "axis_object" is not initialized.')
\ No newline at end of file
+assert(Translation_84.feature().error() == 'Translation axis is not selected.')