-# 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
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")