mirror of https://github.com/fail2ban/fail2ban
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/707/head
parent
d7087412bb
commit
5bafc61e48
|
@ -160,7 +160,7 @@ class Transmitter(TransmitterBase):
|
|||
self.assertEqual(self.transm.proceed(["sleep", "1"]), (0, None))
|
||||
t1 = time.time()
|
||||
# Approx 1 second delay
|
||||
self.assertAlmostEqual(t1 - t0, 1, places=2)
|
||||
self.assertAlmostEqual(t1 - t0, 1, places=1)
|
||||
|
||||
def testAddJail(self):
|
||||
jail2 = "TestJail2"
|
||||
|
|
Loading…
Reference in New Issue