[Git][NTPsec/ntpsec][master] Fixed unicode errors in tests.

Eric S. Raymond gitlab at mg.gitlab.com
Mon May 8 20:57:00 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
4e731fcf by Ian Bruene at 2017-05-08T20:42:10+00:00
Fixed unicode errors in tests.

Tests still used the old \u unicode escapes, instead of the literal strings.

- - - - -


1 changed file:

- tests/pylib/test_util.py


Changes:

=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -177,7 +177,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         nu = ntp.util
 
         # Zero
-        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0\u03bcs")
+        self.assertEqual(f("0.000", nu.UNIT_MS), u"     0µs")
         # Standard, width=8
         self.assertEqual(f("1.234", nu.UNIT_MS), " 1.234ms")
         # ditto, negative
@@ -187,9 +187,9 @@ class TestPylibUtilMethods(unittest.TestCase):
         # ditto, negative
         self.assertEqual(f("-1234.5", nu.UNIT_MS), "-1.2345s")
         # Scale to smaller unit, width=8
-        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34\u03bcs")
+        self.assertEqual(f("0.01234", nu.UNIT_MS), u" 12.34µs")
         # ditto, negative
-        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34\u03bcs")
+        self.assertEqual(f("-0.01234", nu.UNIT_MS), u"-12.34µs")
         # At baseunit
         self.assertEqual(f("12.0", nu.UNIT_NS), "    12ns")
         # Scale to baseunit
@@ -226,7 +226,7 @@ class TestPylibUtilMethods(unittest.TestCase):
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.470 0.420 0.430 0.500 0.460 0.4200 0.490 0.480"),
             u"    470     420     430     500     460   420.0     490     "
-            "480 \u03bcs")
+            u"480 µs")
         # Can't scale
         self.assertEqual(ntp.util.stringfiltcooker(
             "0.47 0.42 0.43 0.50 0.46 0.42 0.49 0.48"),



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4e731fcf421254555da52edad8ef758a750daa6d

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4e731fcf421254555da52edad8ef758a750daa6d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170508/1cb6db3c/attachment.html>


More information about the vc mailing list