[Git][NTPsec/ntpsec][master] Fix RFC 3339 test. seconds have 2 digits, not three.

Gary E. Miller gitlab at mg.gitlab.com
Mon Apr 3 18:57:50 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
d45a807f by Gary E. Miller at 2017-04-03T11:05:20-07:00
Fix RFC 3339 test.  seconds have 2 digits, not three.

Should be optionally support fractional seconds?

- - - - -


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
@@ -9,8 +9,10 @@ class TestPylibUtilMethods(unittest.TestCase):
                          '2016-12-06T04:49:46Z')
         self.assertEqual(ntp.util.rfc3339(1480999786.5),
                          '2016-12-06T04:49:46.5Z')
+        # RFC 3339, 2 digits of seconds.
+        # we round, but the spec is silent on rounding
         self.assertEqual(ntp.util.rfc3339(1480999786.025),
-                         '2016-12-06T04:49:46.025Z')
+                         '2016-12-06T04:49:46.03Z')
 
     def test_portsplit(self):
         self.assertEqual(ntp.util.portsplit("host.invalid"),



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d45a807f8dda448e906e5fd9801c1d2b137dba7e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170403/ecadac1a/attachment.html>


More information about the vc mailing list