From ad82da1d13f8e2c1fb10644e4942816d5db17115 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 17 Dec 2018 14:39:09 +0300 Subject: [PATCH] [Code coverage PrimitivesAPI]: Improve coverage --- test.API/SHAPER/Primitives/TestCone.py | 9 +++++++++ test.API/SHAPER/Primitives/TestSphere.py | 11 ++++++++++- test.API/SHAPER/Primitives/TestTorus.py | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/test.API/SHAPER/Primitives/TestCone.py b/test.API/SHAPER/Primitives/TestCone.py index ebe3d5086..5c3eb51d0 100644 --- a/test.API/SHAPER/Primitives/TestCone.py +++ b/test.API/SHAPER/Primitives/TestCone.py @@ -33,6 +33,9 @@ Cone_13 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), Cone_14 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10., 10., 15.) Cone_15 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), "baseRadius", "topRadius", "h") +Cone_16 = model.addCone(Part_1_doc, 5., 10., 15.) +Cone_16.setRadius(10., 15.) + model.do() model.end() @@ -81,6 +84,12 @@ model.testNbSubShapes(Cone_15, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Cone_15, GeomAPI_Shape.FACE, [3]) model.testHaveNamingFaces(Cone_15, model, Part_1_doc) +model.testNbResults(Cone_16, 1) +model.testNbSubResults(Cone_16, [0]) +model.testNbSubShapes(Cone_16, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Cone_16, GeomAPI_Shape.FACE, [3]) +model.testHaveNamingFaces(Cone_16, model, Part_1_doc) + model.testNbResults(Cone_4, 0) assert(Cone_4.feature().error() == "Cone builder :: base radius is negative.") diff --git a/test.API/SHAPER/Primitives/TestSphere.py b/test.API/SHAPER/Primitives/TestSphere.py index cf80aab10..eb9e36391 100644 --- a/test.API/SHAPER/Primitives/TestSphere.py +++ b/test.API/SHAPER/Primitives/TestSphere.py @@ -20,6 +20,9 @@ Sphere_4 = model.addSphere(Part_1_doc, Point_1, 10) Sphere_5 = model.addSphere(Part_1_doc, Point_2, 10) Sphere_6 = model.addSphere(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), "r") +Sphere_7 = model.addSphere(Part_1_doc, 10) +Sphere_7.setCenterPoint(Point_1) + model.do() model.end() @@ -42,7 +45,13 @@ model.testNbResults(Sphere_6, 1) model.testNbSubResults(Sphere_6, [0]) model.testNbSubShapes(Sphere_6, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Sphere_6, GeomAPI_Shape.FACE, [1]) -model.testHaveNamingFaces(Sphere_4, model, Part_1_doc) +model.testHaveNamingFaces(Sphere_6, model, Part_1_doc) + +model.testNbResults(Sphere_7, 1) +model.testNbSubResults(Sphere_7, [0]) +model.testNbSubShapes(Sphere_7, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Sphere_7, GeomAPI_Shape.FACE, [1]) +model.testHaveNamingFaces(Sphere_7, model, Part_1_doc) model.testNbResults(Sphere_2, 0) assert(Sphere_2.feature().error() == "Sphere builder :: radius is negative or null.") diff --git a/test.API/SHAPER/Primitives/TestTorus.py b/test.API/SHAPER/Primitives/TestTorus.py index a60d9daf3..2dbe07c18 100644 --- a/test.API/SHAPER/Primitives/TestTorus.py +++ b/test.API/SHAPER/Primitives/TestTorus.py @@ -27,6 +27,7 @@ Torus_8 = model.addTorus(Part_1_doc, Point_1, Axis_1, 15, 4) Torus_9 = model.addTorus(Part_1_doc, Point_2, model.selection("EDGE", "PartSet/OZ"), 15, 4) Torus_10 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), Axis_2, 15, 4) Torus_11 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), "r", "ring") +Torus_12 = model.addTorus(Part_1_doc, 15, 4) model.do() model.end() @@ -58,6 +59,12 @@ model.testNbSubShapes(Torus_11, GeomAPI_Shape.SOLID, [1]) model.testNbSubShapes(Torus_11, GeomAPI_Shape.FACE, [1]) model.testHaveNamingFaces(Torus_11, model, Part_1_doc) +model.testNbResults(Torus_12, 1) +model.testNbSubResults(Torus_12, [0]) +model.testNbSubShapes(Torus_12, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Torus_12, GeomAPI_Shape.FACE, [1]) +model.testHaveNamingFaces(Torus_12, model, Part_1_doc) + model.testNbResults(Torus_2, 0) assert(Torus_2.feature().error() == "Torus builder :: ring radius is greater than the radius.") -- 2.39.2