X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FTest%2FTestConstraintDistanceVertical.py;h=5045080d35512ed3ce1f7206e8a4c5776857979b;hb=803c5fda09029cf64d9a21daac18d08cd19e6585;hp=8910edcbfd5613e5da8b4e631d3d12ab6d63b393;hpb=776ad6f8e14da85ee58b1c8da036e2481fdf9c66;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/Test/TestConstraintDistanceVertical.py b/src/SketchPlugin/Test/TestConstraintDistanceVertical.py index 8910edcbf..5045080d3 100644 --- a/src/SketchPlugin/Test/TestConstraintDistanceVertical.py +++ b/src/SketchPlugin/Test/TestConstraintDistanceVertical.py @@ -125,7 +125,10 @@ while d >= -30.: DISTANCE1 = d aDistance.setValue(DISTANCE1) aSession.finishOperation() - assert math.fabs(verticalDistance(aPoint1Coords, aPoint2Coords) - DISTANCE1) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aPoint1Coords, aPoint2Coords), DISTANCE1) + if DISTANCE1 == 0: + assert(aVDist1.error() != "") + else: + assert math.fabs(verticalDistance(aPoint1Coords, aPoint2Coords) - DISTANCE1) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aPoint1Coords, aPoint2Coords), DISTANCE1) d += dStep assert (model.dof(aSketchFeature) == 3) @@ -158,9 +161,12 @@ while d >= -50.: DISTANCE2 = d aDistance.setValue(DISTANCE2) aSession.finishOperation() - assert math.fabs(verticalDistance(anExtCoords, aPoint1Coords) - DISTANCE2) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(anExtCoords, aPoint1Coords), DISTANCE2) - assert math.fabs(aPoint1Coords.y() - DISTANCE2) < 1.e-5, "Wrong point coordinates ({}, {}), expected y = {}".format(aPoint1Coords.x(), aPoint1Coords.y(), DISTANCE2) - assert math.fabs(verticalDistance(aPoint1Coords, aPoint2Coords) - DISTANCE1) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aPoint1Coords, aPoint2Coords), DISTANCE1) + if DISTANCE2 == 0: + assert(aVDist2.error() != "") + else: + assert math.fabs(verticalDistance(anExtCoords, aPoint1Coords) - DISTANCE2) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(anExtCoords, aPoint1Coords), DISTANCE2) + assert math.fabs(aPoint1Coords.y() - DISTANCE2) < 1.e-5, "Wrong point coordinates ({}, {}), expected y = {}".format(aPoint1Coords.x(), aPoint1Coords.y(), DISTANCE2) + assert math.fabs(verticalDistance(aPoint1Coords, aPoint2Coords) - DISTANCE1) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aPoint1Coords, aPoint2Coords), DISTANCE1) d += dStep assert (model.dof(aSketchFeature) == 2) @@ -217,7 +223,10 @@ while d >= -50.: DISTANCE3 = d aDistance.setValue(DISTANCE3) aSession.finishOperation() - assert math.fabs(verticalDistance(aStartPoint, aEndPoint) - DISTANCE3) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aStartPoint, aEndPoint), DISTANCE3) + if DISTANCE3 == 0: + assert(aVDist3.error() != "") + else: + assert math.fabs(verticalDistance(aStartPoint, aEndPoint) - DISTANCE3) < 1.e-5, "Distance values are different: {0} != {1}".format(verticalDistance(aStartPoint, aEndPoint), DISTANCE3) d += dStep assert (model.dof(aSketchFeature) == 6)