From b56d717a36d200272b7a74f14de55ac014726204 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 19 Dec 2018 19:20:47 +0300 Subject: [PATCH] [Code coverage GeomAlgoAPI]: Check errors in Ellipsoid builder --- src/GDMLPlugin/Test/TestEllipsoid.py | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/GDMLPlugin/Test/TestEllipsoid.py b/src/GDMLPlugin/Test/TestEllipsoid.py index 3f7080d20..e113b8739 100644 --- a/src/GDMLPlugin/Test/TestEllipsoid.py +++ b/src/GDMLPlugin/Test/TestEllipsoid.py @@ -74,6 +74,41 @@ model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.EDGE, [7]) model.testNbSubShapes(Ellipsoid_4, GeomAPI_Shape.VERTEX, [14]) model.testResultsVolumes(Ellipsoid_4, [5726.87643051263]) +# Check ellipsoid errors +Part_5 = model.addPart(partSet) +Part_5_doc = Part_5.document() +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 0, 20, 30) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 0, 30) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 0) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, -5, 5) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, 5, -5) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +Ellipsoid_5 = model.addEllipsoid(Part_5_doc, 10, 20, 30, 0, 0) +model.do() +assert(Ellipsoid_5.feature().error() != "") +Part_5_doc.removeFeature(Ellipsoid_5.feature()) + +partSet.removeFeature(Part_5.feature()) + model.end() assert(model.checkPythonDump()) -- 2.39.2