From e6b01eef5f1645c2dc24f089d9aa3936c7da389a Mon Sep 17 00:00:00 2001 From: dbv Date: Mon, 29 Oct 2018 15:53:05 +0300 Subject: [PATCH] Converted boolean tests. --- src/FeaturesPlugin/CMakeLists.txt | 4 +- .../Test/{TestBoolean.py => TestBoolean1.py} | 31 -------------- src/FeaturesPlugin/Test/TestBoolean2.py | 41 +++++++++++++++++++ src/FeaturesPlugin/Test/TestBoolean3.py | 41 +++++++++++++++++++ 4 files changed, 85 insertions(+), 32 deletions(-) rename src/FeaturesPlugin/Test/{TestBoolean.py => TestBoolean1.py} (79%) create mode 100644 src/FeaturesPlugin/Test/TestBoolean2.py create mode 100644 src/FeaturesPlugin/Test/TestBoolean3.py diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index b0ab7042f..544ffa0b8 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -183,7 +183,9 @@ ADD_UNIT_TESTS(TestExtrusion.py TestPlacement_Face_Face.py TestTranslation.py TestRotation.py - TestBoolean.py + TestBoolean1.py + TestBoolean2.py + TestBoolean3.py TestBooleanCompSolids.py TestBooleanSmash.py TestBooleanFill.py diff --git a/src/FeaturesPlugin/Test/TestBoolean.py b/src/FeaturesPlugin/Test/TestBoolean1.py similarity index 79% rename from src/FeaturesPlugin/Test/TestBoolean.py rename to src/FeaturesPlugin/Test/TestBoolean1.py index d7eeb9948..371c30b7d 100644 --- a/src/FeaturesPlugin/Test/TestBoolean.py +++ b/src/FeaturesPlugin/Test/TestBoolean1.py @@ -131,35 +131,4 @@ assert (aBooleanResult is not None) #========================================================================= from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) -model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0) -Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) -model.end() -assert(len(Common_1.results()) > 0) - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() -Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067) -model.do() -Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) -SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) -model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2f")], model.selection(), 10, 0) -Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) -model.end() -assert(len(Smash_1.results()) > 0) - assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBoolean2.py b/src/FeaturesPlugin/Test/TestBoolean2.py new file mode 100644 index 000000000..dc68688d7 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestBoolean2.py @@ -0,0 +1,41 @@ +## 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 +## + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) +model.do() +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")], model.selection(), 10, 0) +Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +model.do() +model.end() +assert(len(Common_1.results()) > 0) + +assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestBoolean3.py b/src/FeaturesPlugin/Test/TestBoolean3.py new file mode 100644 index 000000000..9c027bbc6 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestBoolean3.py @@ -0,0 +1,41 @@ +## 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 +## + +# -*- coding: utf-8 -*- + +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchCircle_1 = Sketch_1.addCircle(-353.344768439108, 0.857632933105, 175.14200032067) +model.do() +Sketch_2 = model.addSketch(Part_1_doc, model.defaultPlane("XOY")) +SketchCircle_2 = Sketch_2.addCircle(-126.929674099485, -2.572898799314, 176.971885556791) +model.do() +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r"), model.selection("FACE", "Sketch_2/Face-SketchCircle_2_2r")], model.selection(), 10, 0) +Smash_1 = model.addSmash(Part_1_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Extrusion_1_2")]) +model.do() +model.end() +assert(len(Smash_1.results()) > 0) + +assert(model.checkPythonDump()) -- 2.39.2