[Git][NTPsec/ntpsec][master] Added test for deunicode_units

Ian Bruene gitlab at mg.gitlab.com
Sat Sep 30 13:53:33 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
5196fdcc by Ian Bruene at 2017-09-30T08:52:44-05:00
Added test for deunicode_units

- - - - -


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
@@ -14,6 +14,23 @@ import jigs
 
 class TestPylibUtilMethods(unittest.TestCase):
 
+    def test_deunicode_units(self):
+        u = ntp.util
+
+        self.assertEqual(u.UNIT_US, u"µs")
+        self.assertEqual(u.UNIT_PPK, u"‰")
+        self.assertEqual(u.UNITS_SEC, ["ns",  u"µs", "ms", "s", "ks"])
+        self.assertEqual(u.UNITS_PPX, ["ppt", "ppb", "ppm", u"‰"])
+        u.deunicode_units()
+        self.assertEqual(u.UNIT_US, "us")
+        self.assertEqual(u.UNIT_PPK, "ppk")
+        self.assertEqual(u.UNITS_SEC, ["ns",  "us", "ms", "s", "ks"])
+        self.assertEqual(u.UNITS_PPX, ["ppt", "ppb", "ppm", "ppk"])
+        u.UNIT_US = u"µs"
+        u.UNIT_PPK = u"‰"
+        u.UNITS_SEC[1] = u.UNIT_US
+        u.UNITS_PPX[3] = u.UNIT_PPK
+
     def test_dolog(self):
         f = ntp.util.dolog
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5196fdcc329eb43ab6319faf3e470867a723b6ad

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/5196fdcc329eb43ab6319faf3e470867a723b6ad
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/20170930/51004f99/attachment.html>


More information about the vc mailing list