From 51d0d4e19e9c5e5e6bac3b97340f63e135ba7fe6 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 24 Mar 2018 14:18:50 -0700 Subject: [PATCH] Using UserString for comparison instead of the actual value to avoid rounding errors depending on the unit-system used. --- src/Mod/Path/PathTests/TestPathSetupSheet.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Mod/Path/PathTests/TestPathSetupSheet.py b/src/Mod/Path/PathTests/TestPathSetupSheet.py index 2fe00e189b..528804b4db 100644 --- a/src/Mod/Path/PathTests/TestPathSetupSheet.py +++ b/src/Mod/Path/PathTests/TestPathSetupSheet.py @@ -79,12 +79,14 @@ class TestPathSetupSheet(PathTestBase): o2.Proxy.setFromTemplate(o1.Proxy.templateAttributes()) self.doc.recompute() + # Need to compare the UserString's due to rounding errors depending on the + # user's unit settings - should have no impact on the validity - self.assertRoughly(o1.VertRapid, o2.VertRapid) - self.assertRoughly(o1.HorizRapid, o2.HorizRapid) - self.assertRoughly(o1.SafeHeightOffset, o2.SafeHeightOffset) + self.assertEqual(o1.VertRapid.UserString, o2.VertRapid.UserString) + self.assertEqual(o1.HorizRapid.UserString, o2.HorizRapid.UserString) + self.assertEqual(o1.SafeHeightOffset.UserString, o2.SafeHeightOffset.UserString) self.assertEqual(o1.SafeHeightExpression, o2.SafeHeightExpression) - self.assertRoughly(o1.ClearanceHeightOffset, o2.ClearanceHeightOffset) + self.assertEqual(o1.ClearanceHeightOffset.UserString, o2.ClearanceHeightOffset.UserString) self.assertEqual(o1.ClearanceHeightExpression, o2.ClearanceHeightExpression) self.assertEqual(o1.StartDepthExpression, o2.StartDepthExpression) self.assertEqual(o1.FinalDepthExpression, o2.FinalDepthExpression)