From: azv Date: Thu, 4 Oct 2018 12:00:52 +0000 (+0300) Subject: Stabilize unit test TestMoveArc by setting higher tolerance for double-values compare X-Git-Tag: CEA_2018-2~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2985fd42b71dd26fc5bdff527ab037a13e359ab4;p=modules%2Fshaper.git Stabilize unit test TestMoveArc by setting higher tolerance for double-values compare For some reason, values 60.00000050101973 and 60.0 are not equal with 6 digits? --- diff --git a/src/SketchPlugin/Test/TestMoveArc.py b/src/SketchPlugin/Test/TestMoveArc.py index ad78cc063..fab42aa61 100644 --- a/src/SketchPlugin/Test/TestMoveArc.py +++ b/src/SketchPlugin/Test/TestMoveArc.py @@ -51,17 +51,17 @@ class TestMoveArc(unittest.TestCase): self.assertEqual(model.dof(self.mySketch), self.myDOF) def checkPointCoordinates(self, thePoint, theCoordinates): - self.assertAlmostEqual(thePoint.x(), theCoordinates[0], 6) - self.assertAlmostEqual(thePoint.y(), theCoordinates[1], 6) + self.assertAlmostEqual(thePoint.x(), theCoordinates[0], 5) + self.assertAlmostEqual(thePoint.y(), theCoordinates[1], 5) def checkPointOnArc(self, theCoordinates): distPC = model.distancePointPoint(self.myArc.center(), theCoordinates) radius = model.distancePointPoint(self.myArc.center(), self.myArc.startPoint()) - self.assertAlmostEqual(distPC, radius, 6) + self.assertAlmostEqual(distPC, radius, 5) def checkArcRadius(self): radius = model.distancePointPoint(self.myArc.center(), self.myArc.startPoint()) - self.assertAlmostEqual(radius, self.myRadius, 6) + self.assertAlmostEqual(radius, self.myRadius, 5) def fixArcRadius(self): self.myRadius = 20.