Salome HOME
Update copyrights
[modules/shaper.git] / test.API / SHAPER / Transformations / TestAPI_MultiTranslation.py
index 5cbbad138e61ed1694e811024b25b405b7d41d51..adf45289dfcd11ba8396fa258689cb0e709ac2c1 100644 (file)
@@ -1,8 +1,21 @@
-# Copyright (C) 2014-201x CEA/DEN, EDF R&D
-
-# File:        TestAPI_MultiTranslation.py
-# Created:     17 Mar 2017
-# Author:      Sylvain Chouteau (Alyotech)
+# Copyright (C) 2014-2019  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
+#
 
 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
@@ -37,25 +50,34 @@ MultiTranslation_2 = shaperpy.makeMultiTranslation(Box_2, ax1, -15., 5)
 
 try:
     MultiTranslation_3 = shaperpy.makeMultiTranslation(Box_3, ax1, 15., -2)
-except myExcept,ec:
+except myExcept as ec:
     assert(ec.what() == "Multitranslation builder :: the number of copies for the first direction is null or negative.")
 
 MultiTranslation_5 = shaperpy.makeMultiTranslation(Box_5, ax1, 10., 5, ax2, 10., 5)
 MultiTranslation_6 = shaperpy.makeMultiTranslation(Box_6, ax1, 15., 5, ax2, -10., 5)
 
 # Tests en erreur
-#try:
-#    MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2)
-#except myExcept,ec:
-#    assert(ec.what() == "Multitranslation builder :: the first axis is not valid.")
+try:
+    MultiTranslation_4 = shaperpy.makeMultiTranslation(Box_4, None, 15., 2)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the first axis is not valid")
 
 # Pas d'exception levee alors qu'une devrait y en avoir une
 try:
     MultiTranslation_7 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., 5, ax2, 10., -2)
-except myExcept,ec:
+except myExcept as ec:
     assert(ec.what() == "Multitranslation builder :: the number of copies for the second direction is null or negative.")
+try:
+    MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_7, ax1, 15., -2, ax2, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the number of copies for the first direction is null or negative.")
 
-#try:
-#    MultiTranslation_8 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5)
-#except myExcept,ec:
-#    assert(ec.what() == "Multitranslation builder :: the second axis is not valid.")
+try:
+    MultiTranslation_9 = shaperpy.makeMultiTranslation(Box_8, None, 15., 5, ax2, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the first axis is not valid")
+
+try:
+    MultiTranslation_10 = shaperpy.makeMultiTranslation(Box_8, ax1, 15., 5, None, 10., 5)
+except myExcept as ec:
+    assert(ec.what() == "Multitranslation builder :: the second axis is not valid")