"""
from GeomDataAPI import *
from ModelAPI import *
+import math
+from salome.shaper import model
+
#=========================================================================
# Initialization of the test
#=========================================================================
aLineAStartPoint.setValue(0., 25.)
aLineAEndPoint.setValue(100., 25.)
aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 4)
#=========================================================================
# Make a constraint to keep the length
#=========================================================================
aSession.finishOperation()
assert (aLength.isInitialized())
assert (refattrA.isInitialized())
+assert (model.dof(aSketchFeature) == 3)
#=========================================================================
# Check values and move one constrainted object
#=========================================================================
aLineAStartPoint.setValue(aLineAStartPoint.x() + deltaX,
aLineAStartPoint.y())
aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 3)
assert (aLineAStartPoint.y() == 25)
assert (aLineAEndPoint.y() == 25)
# length of the line is the same
-assert (aLineAEndPoint.x() - aLineAStartPoint.x() == 100)
+assert (math.fabs(aLineAEndPoint.x() - aLineAStartPoint.x() - 100) < 1.e-10)
#=========================================================================
# Change the length value of the constraint
#=========================================================================
aLength.setValue(140.)
aLengthConstraint.execute()
aSession.finishOperation()
-assert (aLineAEndPoint.x() - aLineAStartPoint.x() == 140)
+assert (math.fabs(aLineAEndPoint.x() - aLineAStartPoint.x() - 140) < 1.e-10)
+assert (model.dof(aSketchFeature) == 3)
#=========================================================================
# TODO: improve test
# 1. remove constraint, move line's start point to
#=========================================================================
# End of test
#=========================================================================
+
+assert(model.checkPythonDump())