Merge pull request #342 from grooverdan/datedetector_test

TST: improve datedetector error reporting
pull/319/merge
Yaroslav Halchenko 2013-08-31 06:53:59 -07:00
commit cd100ce274
1 changed files with 4 additions and 2 deletions

View File

@ -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()]