ENH(TST): relax test of sleep to "1" places from "2"

The reason is that internally it does round, so even 1.005 then would not
be equal to 1.  Making it spaces==1 should be sufficient for up to 1.05
i.e. we would allow 50ms "drift"
pull/697/head
Yaroslav Halchenko 2014-04-16 13:17:58 -04:00
parent d4427e5a76
commit c2289bc8fe
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ class Transmitter(TransmitterBase):
self.assertEqual(self.transm.proceed(["sleep", "1"]), (0, None)) self.assertEqual(self.transm.proceed(["sleep", "1"]), (0, None))
t1 = time.time() t1 = time.time()
# Approx 1 second delay # Approx 1 second delay
self.assertAlmostEqual(t1 - t0, 1, places=2) self.assertAlmostEqual(t1 - t0, 1, places=1)
def testDatabase(self): def testDatabase(self):
_, tmpFilename = tempfile.mkstemp(".db", "Fail2Ban_") _, tmpFilename = tempfile.mkstemp(".db", "Fail2Ban_")