[Git][NTPsec/ntpsec][master] Changed new tests to only use assertEqual

Ian Bruene gitlab at mg.gitlab.com
Tue Oct 24 23:43:51 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
f5419095 by Ian Bruene at 2017-10-24T18:41:47-05:00
Changed new tests to only use assertEqual

CentOS 6 still uses an earlier version of Python than 2.7. The assertLess,
assertLessEqual, assertGreater, assertGreaterEqual methods were introduced
in python 2.7.

- - - - -


1 changed file:

- tests/pylib/test_agentx.py


Changes:

=====================================
tests/pylib/test_agentx.py
=====================================
--- a/tests/pylib/test_agentx.py
+++ b/tests/pylib/test_agentx.py
@@ -1708,19 +1708,19 @@ class TestNtpclientsNtpsnmpd(unittest.TestCase):
         self.assertEqual(a.compareOID(b), -1)
         # Test direct comparisons
         # Test ==
-        self.assertEqual(target((1, 2, 3)), target((1, 2, 3)))
+        self.assertEqual(target((1, 2, 3)) == target((1, 2, 3)), True)
         # Test !=
-        self.assertNotEqual(target((1, 2, 3)), target((1, 2)))
+        self.assertEqual(target((1, 2, 3)) != target((1, 2)), True)
         # Test <
-        self.assertLess(target((1, 2)), target((1, 2, 3)))
+        self.assertEqual(target((1, 2)) < target((1, 2, 3)), True)
         # Test >
-        self.assertGreater(target((1, 2, 3)), target((1, 2)))
+        self.assertEqual(target((1, 2, 3)) > target((1, 2)), True)
         # Test <=
-        self.assertLessEqual(target((1, 2)), target((1, 2, 3)))
-        self.assertLessEqual(target((1, 2, 3)), target((1, 2, 3)))
+        self.assertEqual(target((1, 2)) <= target((1, 2, 3)), True)
+        self.assertEqual(target((1, 2, 3)) <= target((1, 2, 3)), True)
         # Test >=
-        self.assertGreaterEqual(target((1, 2, 3)), target((1, 2)))
-        self.assertGreaterEqual(target((1, 2, 3)), target((1, 2, 3)))
+        self.assertEqual(target((1, 2, 3)) >= target((1, 2)), True)
+        self.assertEqual(target((1, 2, 3)) >= target((1, 2, 3)), True)
 
     def test_searchrange(self):
         target = ntp.agentx.SearchRange



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f54190956f7dac292d3c4460dee0f028f2bb2450
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/20171024/72e0b3b4/attachment.html>


More information about the vc mailing list