[Git][NTPsec/ntpsec][master] util.py tests now work with Python 3, fixed missing future division import

Ian Bruene gitlab at mg.gitlab.com
Thu Sep 21 23:35:33 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
9765c7ce by Ian Bruene at 2017-09-21T23:33:53Z
util.py tests now work with Python 3, fixed missing future division import

- - - - -


2 changed files:

- pylib/util.py
- tests/pylib/test_util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -2,7 +2,7 @@
 # Common utility functions
 # SPDX-License-Identifier: BSD-2-clause
 
-from __future__ import print_function
+from __future__ import print_function, division
 
 
 import collections


=====================================
tests/pylib/test_util.py
=====================================
--- a/tests/pylib/test_util.py
+++ b/tests/pylib/test_util.py
@@ -850,7 +850,7 @@ class TestPylibUtilMethods(unittest.TestCase):
             fakesockmod.gai_returns = [("fam", "type", "proto",
                                         "foo.bar.com", "1.2.3.4")]
             self.assertEqual(cls.summary(ent),
-                             "64730 23296      0  400 K 7 2"
+                             "64730     0      0  400 K 7 2"
                              "      1    42 1.2.3.4")
             # Test summary, second options
             mycache._cache = {}
@@ -864,7 +864,7 @@ class TestPylibUtilMethods(unittest.TestCase):
                                          "foo.bar.com", ("1.2.3.4", 42))]]
             cdns_jig_returns = ["foo.com"]
             self.assertEqual(cls.summary(ent),
-                             "64730 23808   4.00   20 L 7 2     65"
+                             "64730     0   4.00   20 L 7 2     65"
                              "    42 foo.com")
             # Test summary, third options
             mycache._cache = {}
@@ -873,7 +873,7 @@ class TestPylibUtilMethods(unittest.TestCase):
             fakesockmod.gai_error_count = 1
             cdns_jig_returns = ["foobarbaz" * 5]  # 45 chars, will be cropped
             self.assertEqual(cls.summary(ent),
-                             "64730 23808    256    0 . 7 2      2    42"
+                             "64730     0    256    0 . 7 2      2    42"
                              " 1.2.3.4 (foobarbazfoobarbazfoobarbazfoob")
             # Test summary, wide
             mycache._cache = {}
@@ -881,7 +881,7 @@ class TestPylibUtilMethods(unittest.TestCase):
             fakesockmod.gai_error_count = 1
             cdns_jig_returns = ["foobarbaz" * 5]  # 45 chars, will be cropped
             self.assertEqual(cls.summary(ent),
-                             "64730 23808    256    0 . 7 2      2"
+                             "64730     0    256    0 . 7 2      2"
                              "    42 1.2.3.4 "
                              "(foobarbazfoobarbazfoobarbazfoobarbazfoobarbaz)")
         finally:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9765c7ce597f0933f8b45fa627d195262be4ed6f

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/9765c7ce597f0933f8b45fa627d195262be4ed6f
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/20170921/67352988/attachment.html>


More information about the vc mailing list