From abc6913cbf8b2a5d2f769b3c51a5149ec5e4ea4d Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 19 Dec 2018 17:43:41 +0300 Subject: [PATCH] [Code coverage GeomAPI]: Unit test for planar edge --- src/GeomAPI/CMakeLists.txt | 1 + src/GeomAPI/Test/TestPlanarEdge.py | 36 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/GeomAPI/Test/TestPlanarEdge.py diff --git a/src/GeomAPI/CMakeLists.txt b/src/GeomAPI/CMakeLists.txt index 0c1b55f63..88f8aefcb 100644 --- a/src/GeomAPI/CMakeLists.txt +++ b/src/GeomAPI/CMakeLists.txt @@ -163,6 +163,7 @@ ADD_UNIT_TESTS( TestBox.py TestCone.py TestCylinder.py + TestPlanarEdge.py TestPolygon.py TestSphere.py TestTorus.py diff --git a/src/GeomAPI/Test/TestPlanarEdge.py b/src/GeomAPI/Test/TestPlanarEdge.py new file mode 100644 index 000000000..68c5b3648 --- /dev/null +++ b/src/GeomAPI/Test/TestPlanarEdge.py @@ -0,0 +1,36 @@ +## 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 +## + +from salome.shaper import model +from GeomAPI import * + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +Interpolation_1_objects = [model.selection("VERTEX", "[Box_1_1/Back][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Bottom]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Left][Box_1_1/Top]"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Top]")] +Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, False, False) + +aShape = Interpolation_1.result().resultSubShapePair()[0].shape() +assert(aShape.isEdge()) +assert(aShape.isPlanar() == False) + +model.end() -- 2.39.2