BF(PY26): no assertGreater in 2.6 -- use explicit comparison

pull/1196/head
Yaroslav Halchenko 2015-09-23 09:45:51 -04:00
parent 17a4289798
commit 84afcd8b1f
1 changed files with 3 additions and 3 deletions

View File

@ -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_")