From 84afcd8b1f57c3115e77f9b75ae86ba9de98b21f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 23 Sep 2015 09:45:51 -0400 Subject: [PATCH] BF(PY26): no assertGreater in 2.6 -- use explicit comparison --- fail2ban/tests/servertestcase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py index afa6162e..86ffdb46 100644 --- a/fail2ban/tests/servertestcase.py +++ b/fail2ban/tests/servertestcase.py @@ -168,9 +168,9 @@ class Transmitter(TransmitterBase): t0 = time.time() self.assertEqual(self.transm.proceed(["sleep", "1"]), (0, None)) t1 = time.time() - # Approx 1 second delay - self.assertGreater(t1 - t0, 0.99) # shouldn't be faster than 1sec - self.assertGreater(1.1, t1 - t0) + # Approx 1 second delay but not faster + dt = t1 - t0 + self.assertTrue(0.99 < dt < 1.1, msg="Sleep was %g sec" % dt) def testDatabase(self): tmp, tmpFilename = tempfile.mkstemp(".db", "fail2ban_")