Salome HOME
Issue #2082 Sketch multiple rotation does not work as expected: debug information
[modules/shaper.git] / src / SketchPlugin / Test / TestConstraintPerpendicular.py
index 64e15c899af7b1d0195aa9d8b7d9ec99618e05f0..43fa7aaf3de1e6d5ec9d469bf0cdb2ec7ac64d25 100644 (file)
@@ -18,6 +18,8 @@
 """
 from GeomDataAPI import *
 from ModelAPI import *
+from salome.shaper import model
+
 #=========================================================================
 # Initialization of the test
 #=========================================================================
@@ -36,8 +38,6 @@ origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
 origin.setValue(0, 0, 0)
 dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
-diry = geomDataAPI_Dir(aSketchFeature.attribute("DirY"))
-diry.setValue(0, 1, 0)
 norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
 aSession.finishOperation()
@@ -58,6 +58,7 @@ aLineBEndPoint = geomDataAPI_Point2D(aSketchLineB.attribute("EndPoint"))
 aLineBStartPoint.setValue(25., 40.)
 aLineBEndPoint.setValue(25., 125.)
 aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 8)
 #=========================================================================
 # Make a constraint to keep the length of the line constant
 # to prevent perpendicular constraint collapsing line to point
@@ -81,6 +82,7 @@ assert (aLineBStartPoint.x() == 25)
 assert (aLineBStartPoint.y() == 40)
 assert (aLineBEndPoint.x() == 25)
 assert (aLineBEndPoint.y() == 125)
+assert (model.dof(aSketchFeature) == 6)
 #=========================================================================
 # Link lines with perpendicular constraint
 #=========================================================================
@@ -96,6 +98,7 @@ refattrA.setObject(aResultA)
 refattrB.setObject(aResultB)
 aPerpendicularConstraint.execute()
 aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 5)
 #=========================================================================
 # Check values and move one constrainted object
 #=========================================================================
@@ -120,6 +123,9 @@ aLineAEndPoint.setValue(aLineAEndPoint.x() - deltaX, aLineAEndPoint.y() - deltaY
 aSession.finishOperation()
 assert (aLineBStartPointPrev != (aLineBStartPoint.x(), aLineBStartPoint.y()))
 assert (aLineBEndPointPrev   != (aLineBEndPoint.x(),   aLineBEndPoint.y()))
+assert (model.dof(aSketchFeature) == 5)
 #=========================================================================
 # End of test
 #=========================================================================
+
+assert(model.checkPythonDump())