Пример #1
0
 def test_good_year_datetime_output(self):
     """Ensure a good date is printed correctly)"""
     obj = awstats_reader.awstats_datetime('20110430184200')
     self.assertEqual(obj.strftime('%Y%m%d%H%M%S'), '20110430184200')
Пример #2
0
 def test_year_zero_datetime_output(self):
     """Ensure the Awstats 'year zero' is printed correctly"""
     obj = awstats_reader.awstats_datetime('0')
     self.assertEqual(obj.strftime('%Y%m%d%H%M%S'), '0')
Пример #3
0
 def test_8_digit_date_detection(self):
     """Ensure the AwstatsDate object is returned"""
     obj = awstats_reader.awstats_datetime('20091130')
     self.assertTrue(isinstance(obj, awstats_reader.AwstatsDate))
Пример #4
0
 def test_year_year_zero_datetime_parse(self):
     """Ensure the Awstats 'year zero' is parsed correctly"""
     obj = awstats_reader.awstats_datetime('0')
     self.assertEqual(obj,datetime.datetime(1,1,1))
Пример #5
0
 def test_8_digit_date(self):
     """Ensure date strings are being evaluated correctly"""
     obj = awstats_reader.awstats_datetime('20091130')
     dt = datetime.date(2009, 11, 30)
     self.assertEqual(obj, dt)