mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
- Added one more test for the date detector
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@341 a942ae1a-1317-0410-a47c-b1dcaea8d605
This commit is contained in:
parent
2c265a5df0
commit
75af04eeaf
1 changed files with 8 additions and 0 deletions
|
|
@ -38,6 +38,14 @@ class DateDetectorTest(unittest.TestCase):
|
|||
def tearDown(self):
|
||||
"""Call after every test case."""
|
||||
|
||||
def testGetEpochTime(self):
|
||||
log = "1138049999 [sshd] error: PAM: Authentication failure"
|
||||
date = [2006, 1, 23, 20, 59, 59, 0, 23, 0]
|
||||
dateUnix = 1138046399.0
|
||||
|
||||
self.assertEqual(self.datedetector.getTime(log), date)
|
||||
self.assertEqual(self.datedetector.getUnixTime(log), dateUnix)
|
||||
|
||||
def testGetTime(self):
|
||||
log = "Jan 23 21:59:59 [sshd] error: PAM: Authentication failure"
|
||||
date = [2006, 1, 23, 21, 59, 59, 1, 23, -1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue