"""
from GeomDataAPI import *
from ModelAPI import *
-import os
import math
+from salome.shaper import model
#=========================================================================
# Auxiliary functions
aStartPoint.setValue(-10., 15.)
aEndPoint.setValue(80., 50.)
aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 8)
#=========================================================================
# Make a constraint to keep the angle
#=========================================================================
assert (refattrA.isInitialized())
assert (refattrB.isInitialized())
assert (angle(aSketchLineA, aSketchLineB) == ANGLE_DEGREE)
+assert (model.dof(aSketchFeature) == 7)
#=========================================================================
# Move line, check that angle is constant
#=========================================================================
aConstraint.execute()
aSession.finishOperation()
assert (angle(aSketchLineA, aSketchLineB) == ANGLE_DEGREE)
+assert (model.dof(aSketchFeature) == 7)
#=========================================================================
# Change angle value and check the lines are moved
#=========================================================================
aConstraint.execute()
aSession.finishOperation()
assert (angle(aSketchLineA, aSketchLineB) == NEW_ANGLE_DEGREE)
+assert (model.dof(aSketchFeature) == 7)
#=========================================================================
# Change angle type
#=========================================================================
aConstraint.integer("AngleType").setValue(ANGLE_BACKWARD)
aSession.finishOperation()
assert (angle(aSketchLineA, aSketchLineB) == NEW_ANGLE_DEGREE)
+assert (model.dof(aSketchFeature) == 7)
#=========================================================================
-# TODO: improve test
-# 1. remove constraint, move line's start point to
-# check that constraint are not applied
-# 2. check constrained distance between:
-# * point and line
-# * two lines
+# Remove constraint, move line's point to check the constraint is not applied
#=========================================================================
+aSession.startOperation()
+aDocument.removeFeature(aConstraint)
+aSession.finishOperation()
+assert (model.dof(aSketchFeature) == 8)
+aSession.startOperation()
+aStartPoint.setValue(-30., 0.)
+aSession.finishOperation()
+assert (angle(aSketchLineA, aSketchLineB) != NEW_ANGLE_DEGREE)
+assert (model.dof(aSketchFeature) == 8)
#=========================================================================
# End of test
#=========================================================================
-from salome.shaper import model
assert(model.checkPythonDump())