]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py
Salome HOME
[Code coverage FeaturesPlugin]: Unit tests for error messages
[modules/shaper.git] / src / FeaturesPlugin / Test / TestBooleanFuse_ErrorMsg.py
diff --git a/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py b/src/FeaturesPlugin/Test/TestBooleanFuse_ErrorMsg.py
new file mode 100644 (file)
index 0000000..17441ab
--- /dev/null
@@ -0,0 +1,41 @@
+## Copyright (C) 2018-20xx  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>
+##
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
+Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "Cylinder_1_1"), model.selection("FACE", "PartSet/XOZ")])
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1"), model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", "Partition_1_1_1")], [model.selection("SOLID", "Partition_1_1_2")])
+assert(Fuse_1.feature().error() != "")
+Part_1_doc.removeFeature(Fuse_1.feature())
+model.end()