Skip to content

Commit

Permalink
Very minor problem. Thest if sheets is impacted by the locale. The de…
Browse files Browse the repository at this point in the history
…cimal separator may be , instead of .

A assertEqualLocale has been added to compare these values with the expected string containing a . as decila separator.

Works fine
  • Loading branch information
plgarcia committed Nov 6, 2017
1 parent 4c30d9b commit a63156f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/Mod/Path/PathTests/PathTestUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@ def assertCommandEqual(self, c1, c2):
self.assertRoughly(c1.Parameters.get('I', 0), c2.Parameters.get('I', 0))
self.assertRoughly(c1.Parameters.get('J', 0), c2.Parameters.get('J', 0))
self.assertRoughly(c1.Parameters.get('K', 0), c2.Parameters.get('K', 0))

def assertEqualLocale(self,s1,s2):
"""Verify that the 2 strings are equivalent, but converts eventual , into . for the first string that may be affected by locale."""
self.assertEqual(s1.replace(",","."), s2)

8 changes: 4 additions & 4 deletions src/Mod/Path/PathTests/TestPathSetupSheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def test00(self):

attrs = ss.templateAttributes(True, True)

self.assertEqual(attrs[PathSetupSheet.Template.HorizRapid], '0.00 mm/s')
self.assertEqual(attrs[PathSetupSheet.Template.VertRapid], '0.00 mm/s')
self.assertEqual(attrs[PathSetupSheet.Template.SafeHeightOffset], '3.00 mm')
self.assertEqualLocale(attrs[PathSetupSheet.Template.HorizRapid], '0.00 mm/s')
self.assertEqualLocale(attrs[PathSetupSheet.Template.VertRapid], '0.00 mm/s')
self.assertEqualLocale(attrs[PathSetupSheet.Template.SafeHeightOffset], '3.00 mm')
self.assertEqual(attrs[PathSetupSheet.Template.SafeHeightExpression], 'StartDepth+SetupSheet.SafeHeightOffset')
self.assertEqual(attrs[PathSetupSheet.Template.ClearanceHeightOffset], '5.00 mm')
self.assertEqualLocale(attrs[PathSetupSheet.Template.ClearanceHeightOffset], '5.00 mm')
self.assertEqual(attrs[PathSetupSheet.Template.ClearanceHeightExpression], 'StartDepth+SetupSheet.ClearanceHeightOffset')

def test01(self):
Expand Down

0 comments on commit a63156f

Please sign in to comment.