예제 #1
0
 def testLogHandlerInit(self):
     self.assertTrue(self.lh.bytes>0)
     self.assertTrue(self.lh.first is not None)
     self.assertTrue(self.lh.last is not None)
     
     first = "Feb  9 06:52:00"
     last = "Feb 10 06:23:46"
     self.assertEqual(make_datetime(first), self.lh.first)
     self.assertEqual(make_datetime(last), self.lh.last)
예제 #2
0
 def testRight(self):
     dti = make_datetime("Feb  9 06:", False)
     self.assertEqual(2, dti.month)
     self.assertEqual(9, dti.day)
     self.assertEqual(24, dti.hour)
     self.assertEqual(60, dti.minute)
     self.assertEqual(60, dti.second)
예제 #3
0
 def testLeft(self):
     dti = make_datetime("Feb  9 06:", True)
     self.assertEqual(2, dti.month)
     self.assertEqual(9, dti.day)
     self.assertEqual(0, dti.hour)
     self.assertEqual(0, dti.minute)
     self.assertEqual(0, dti.second)
예제 #4
0
 def testFull(self):
     dti = make_datetime("Feb  9 06:52:00")
     self.assertEqual(2, dti.month)
     self.assertEqual(9, dti.day)
     self.assertEqual(6, dti.hour)
     self.assertEqual(52, dti.minute)
     self.assertEqual(0, dti.second)
예제 #5
0
 def testLeftSide(self):
     '''Test finding the left edge of a homogeneous block.'''
     param = 'Feb  9 07:50:27'
     date = make_datetime(param)
     self.assertEqual(68, self.lh.get_offset(date))
예제 #6
0
 def testRightSide(self):
     '''Test finding the right edge of a homgeneous block.'''
     param = 'Feb  9 07:50:27'
     date = make_datetime(param)
     self.assertEqual(210, self.lh.get_offset(date, False))
예제 #7
0
 def testSingleMiddle2(self):
     param = 'Feb  9 18:35:15 '
     date = make_datetime(param)
     self.assertEqual(674, self.lh.get_offset(date))
예제 #8
0
 def testSingleMiddle(self):
     param = 'Feb 9 16:36:41'
     date = make_datetime(param)
     self.assertEqual(560, self.lh.get_offset(date))
예제 #9
0
 def testSingleLastRightside(self):
     param = 'Feb 10 06:23:46'
     date = make_datetime(param)
     self.assertEqual(1350, self.lh.get_offset(date,False))    
예제 #10
0
 def testSingleFirst(self):
     param = 'Feb 9 06:52:00'
     date = make_datetime(param)
     self.assertEqual(0, self.lh.get_offset(date))