Salome HOME
Revert "Merge branch 'Pre_2.8.0_development'"
[modules/shaper.git] / src / SketchPlugin / Test / TestCreateArcChangeType.py
index 851241a02a20a1cac14eceaade0c995cd3a1b65e..88ad0c60ed677acca958c6631e3f3f9dd2cb62a3 100644 (file)
@@ -88,7 +88,19 @@ def verifyLastArc(theSketch, theCenter, theStart, theEnd):
     subroutine to verify position of last arc in the sketch
     """
     aLastArc = model.lastSubFeature(theSketch, "SketchArc")
-    model.assertArc(aLastArc, theCenter, theStart, theEnd)
+    aCenterPnt = geomDataAPI_Point2D(aLastArc.attribute("center_point"))
+    aStartPnt = geomDataAPI_Point2D(aLastArc.attribute("start_point"))
+    aEndPnt = geomDataAPI_Point2D(aLastArc.attribute("end_point"))
+    if len(theCenter):
+        verifyPointCoordinates(aCenterPnt, theCenter[0], theCenter[1])
+    if len(theStart):
+        verifyPointCoordinates(aStartPnt, theStart[0], theStart[1])
+    if len(theEnd):
+        verifyPointCoordinates(aEndPnt, theEnd[0], theEnd[1])
+    model.assertSketchArc(aLastArc)
+
+def verifyPointCoordinates(thePoint, theX, theY):
+    assert thePoint.x() == theX and thePoint.y() == theY, "Wrong '{0}' point ({1}, {2}), expected ({3}, {4})".format(thePoint.id(), thePoint.x(), thePoint.y(), theX, theY)
 
 
 #=========================================================================