Salome HOME
[Code coverage PrimitivesAPI]: Improve coverage
authorazv <azv@opencascade.com>
Mon, 17 Dec 2018 11:39:09 +0000 (14:39 +0300)
committerazv <azv@opencascade.com>
Tue, 18 Dec 2018 04:24:17 +0000 (07:24 +0300)
test.API/SHAPER/Primitives/TestCone.py
test.API/SHAPER/Primitives/TestSphere.py
test.API/SHAPER/Primitives/TestTorus.py

index ebe3d508696ac40e9d7e19ebb440dadafe0fd070..5c3eb51d0121455b5034c595a8035bf04a3c1ba6 100644 (file)
@@ -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.")
 
index cf80aab10c0eea6dc6390dfb500ee63520e93bbb..eb9e363917bd8318bd16fc0d56237a41002a167f 100644 (file)
@@ -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.")
index a60d9daf35ee265dc1282eea362cd13230c7d42c..2dbe07c18f02b1716076f33a61bcaf7e92cc0c9e 100644 (file)
@@ -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.")