Salome HOME
updated copyright message
[modules/shaper.git] / src / BuildPlugin / Test / TestShell.py
index 4b371b9728cd60f77a7f6694e2e483c682db0538..9e732f23b10325e2a652d957e19f0f70a72503dc 100644 (file)
@@ -1,22 +1,21 @@
-## 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>
-##
+# 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
+#
 
 # Initialization of the test
 from ModelAPI import *
@@ -123,5 +122,22 @@ aSession.finishOperation()
 # Test results
 assert (len(aShellFeature2.results()) > 0)
 
+# Check Shell feature failed on incorrect input
+aShellResult = aShellFeature.firstResult()
+aSession.startOperation()
+aShellFeature3 = aPart.addFeature("Shell")
+aBaseObjectsList = aShellFeature3.selectionList("base_objects")
+aShapeExplorer = GeomAPI_ShapeExplorer(aShellResult.shape(), GeomAPI_Shape.EDGE)
+while aShapeExplorer.more():
+    aBaseObjectsList.append(aShellResult, aShapeExplorer.current())
+    aShapeExplorer.next()
+aSession.finishOperation()
+assert (len(aShellFeature3.results()) == 0)
+
+# remove failed feature
+aSession.startOperation()
+aPart.removeFeature(aShellFeature3)
+aSession.finishOperation()
+
 from salome.shaper import model
 assert(model.checkPythonDump())