]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
[Code coverage GeomAPI]: Call methods related to GUI
authorazv <azv@opencascade.com>
Wed, 19 Dec 2018 14:58:35 +0000 (17:58 +0300)
committerazv <azv@opencascade.com>
Wed, 19 Dec 2018 14:58:35 +0000 (17:58 +0300)
src/GeomAPI/Test/TestCone.py
src/GeomAPI/Test/TestPolygon.py

index 82ba81bcb6e251565e33be89a16b586d08a8647d..e82be0d97d54ae94f695829cca2436f47efa37bc 100644 (file)
@@ -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()
index 7f66006261d1e183ea18fe1cd0e4d5b4ff39d9d5..8ffb2b1dab53ac9a04d986a5a921fe6de864c212 100644 (file)
@@ -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())