mirror of https://github.com/fail2ban/fail2ban
Merge pull request #342 from grooverdan/datedetector_test
TST: improve datedetector error reportingpull/319/merge
commit
cd100ce274
|
@ -88,8 +88,10 @@ class DateDetectorTest(unittest.TestCase):
|
|||
# exclude
|
||||
|
||||
# yoh: on [:6] see in above test
|
||||
self.assertEqual(self.__datedetector.getTime(log)[:6], date[:6])
|
||||
self.assertEqual(self.__datedetector.getUnixTime(log), dateUnix)
|
||||
logtime = self.__datedetector.getTime(log)
|
||||
self.assertNotEqual(logtime, None, "getTime retrieved nothing: failure for %s" % sdate)
|
||||
self.assertEqual(logtime[:6], date[:6], "getTime comparison failure for %s: \"%s\" is not \"%s\"" % (sdate, logtime[:6], date[:6]))
|
||||
self.assertEqual(self.__datedetector.getUnixTime(log), dateUnix, "getUnixTime failure for %s: \"%s\" is not \"%s\"" % (sdate, logtime[:6], date[:6]))
|
||||
|
||||
def testStableSortTemplate(self):
|
||||
old_names = [x.getName() for x in self.__datedetector.getTemplates()]
|
||||
|
|
Loading…
Reference in New Issue