-# Copyright (C) 2014-201x CEA/DEN, EDF R&D
-
-# File: TestAPI_Cylinder.py
-# Created: 13 Jan 2017
-# Author: Clarisse Genrault (CEA)
+# Copyright (C) 2014-2023 CEA, EDF
+#
+# 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:
Cylinder_4 = shaperpy.makeCylinder(0., 10.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: radius is negative or null.")
try:
Cylinder_5 = shaperpy.makeCylinder(-5., 10.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: radius is negative or null.")
try:
Cylinder_6 = shaperpy.makeCylinder(5., 0.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: height is negative or null.")
try:
Cylinder_7 = shaperpy.makeCylinder(5., -10.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: height is negative or null.")
try:
Cylinder_8 = shaperpy.makeCylinder(None, edgz, 5., 10.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: the base point is not valid.")
try:
Cylinder_9 = shaperpy.makeCylinder(pnt1, None, 5., 10.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: the axis is not valid.")
Cylinder_14 = shaperpy.makeCylinder(5., 10., 45.)
try:
Cylinder_18 = shaperpy.makeCylinder(0., 10., 45.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: radius is negative or null.")
try:
Cylinder_19 = shaperpy.makeCylinder(-5., 10., 45.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: radius is negative or null.")
try:
Cylinder_20 = shaperpy.makeCylinder(5., 0., 45.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: height is negative or null.")
try:
Cylinder_21 = shaperpy.makeCylinder(5., -10., 45.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: height is negative or null.")
try:
Cylinder_22 = shaperpy.makeCylinder(5., 10., 0.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: angle is negative or null.")
try:
Cylinder_23 = shaperpy.makeCylinder(5., 10., -45.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: angle is negative or null.")
try:
Cylinder_24 = shaperpy.makeCylinder(5., 10., 450.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: angle greater than 360 degrees.")
try:
Cylinder_25 = shaperpy.makeCylinder(None, edgz, 5., 10., 90.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: the base point is not valid.")
try:
Cylinder_26 = shaperpy.makeCylinder(pnt1, None, 5., 10., 90.)
-except myExcept,ec:
+except myExcept as ec:
assert(ec.what() == "Cylinder builder :: the axis is not valid.")
\ No newline at end of file