From: azv Date: Wed, 19 Dec 2018 14:58:35 +0000 (+0300) Subject: [Code coverage GeomAPI]: Call methods related to GUI X-Git-Tag: End2018~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=00fbd7375466acd098605a9acfbe089b056c772d;p=modules%2Fshaper.git [Code coverage GeomAPI]: Call methods related to GUI --- diff --git a/src/GeomAPI/Test/TestCone.py b/src/GeomAPI/Test/TestCone.py index 82ba81bcb..e82be0d97 100644 --- a/src/GeomAPI/Test/TestCone.py +++ b/src/GeomAPI/Test/TestCone.py @@ -37,6 +37,7 @@ def checkCircleEdge(theDocument, theEdgeName, theCenter, theRadius): anEdge = model.addEdge(theDocument, [model.selection("EDGE", theEdgeName)]) aShape = anEdge.result().resultSubShapePair()[0].shape() assert(aShape.isEdge()) + assert(aShape.edge().isClosed()) assertCircle(aShape.edge(), theCenter, theRadius) theDocument.removeFeature(anEdge.feature()) @@ -277,4 +278,16 @@ checkNonConeShell(Shell_1) Shell_2 = model.addShell(Part_1_doc, [model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_2_1/Face_1"), model.selection("FACE", "Fuse_1_1/Modified_Face&Cone_3_1/Face_1")]) checkNonConeShell(Shell_2) +# Test 9. Check error on conversion to wrong type of curve +anEdge = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Cone_1_1/Face_1][Rotation_1_1/MF:Rotated&Cone_1_1/Face_2]")]) +aShape = anEdge.result().resultSubShapePair()[0].shape() +assert(aShape.isEdge()) +assert(aShape.edge().ellipse() is None) +assert(aShape.edge().line() is None) + +anEdge = model.addEdge(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Cone_1_1/Face_1][weak_name_2]")]) +aShape = anEdge.result().resultSubShapePair()[0].shape() +assert(aShape.isEdge()) +assert(aShape.edge().circle() is None) + model.end() diff --git a/src/GeomAPI/Test/TestPolygon.py b/src/GeomAPI/Test/TestPolygon.py index 7f6600626..8ffb2b1da 100644 --- a/src/GeomAPI/Test/TestPolygon.py +++ b/src/GeomAPI/Test/TestPolygon.py @@ -48,6 +48,7 @@ def checkRectangleWire(theDocument, theEdgeNames): aWire = model.addWire(theDocument, aSelection) aShape = aWire.result().resultSubShapePair()[0].shape() assert(aShape.isWire()) + assert(aShape.wire().isClosed()) assertRectangle(aShape.wire()) theDocument.removeFeature(aWire.feature())