Esempio n. 1
0
 def test_day(self):
     begin, end = utils.last_completed_audit_period(unit='day')
     self.assertEqual(begin, datetime.datetime(day=4,
                                               month=3,
                                               year=2012))
     self.assertEqual(end, datetime.datetime(day=5,
                                             month=3,
                                             year=2012))
Esempio n. 2
0
 def test_month_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='month@15')
     self.assertEqual(begin, datetime.datetime(day=15,
                                               month=1,
                                               year=2012))
     self.assertEqual(end, datetime.datetime(day=15,
                                             month=2,
                                             year=2012))
Esempio n. 3
0
 def test_year(self):
     begin, end = utils.last_completed_audit_period(unit='year')
     self.assertEqual(begin, datetime.datetime(day=1,
                                               month=1,
                                               year=2011))
     self.assertEqual(end, datetime.datetime(day=1,
                                             month=1,
                                             year=2012))
Esempio n. 4
0
 def test_year_with_offset_before_current(self):
     begin, end = utils.last_completed_audit_period(unit='year@2')
     self.assertEquals(begin, datetime.datetime(day=1,
                                                month=2,
                                                year=2011))
     self.assertEquals(end, datetime.datetime(day=1,
                                              month=2,
                                              year=2012))
Esempio n. 5
0
 def test_month(self):
     begin, end = utils.last_completed_audit_period(unit='month')
     self.assertEquals(begin, datetime.datetime(day=1,
                                                month=2,
                                                year=2012))
     self.assertEquals(end, datetime.datetime(day=1,
                                              month=3,
                                              year=2012))
Esempio n. 6
0
 def test_year_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='year@6')
     self.assertEqual(begin, datetime.datetime(day=1,
                                               month=6,
                                               year=2010))
     self.assertEqual(end, datetime.datetime(day=1,
                                             month=6,
                                             year=2011))
Esempio n. 7
0
 def test_day_with_offset_before_current(self):
     begin, end = utils.last_completed_audit_period(unit='day@6')
     self.assertEquals(begin, datetime.datetime(hour=6,
                                                day=4,
                                                month=3,
                                                year=2012))
     self.assertEquals(end, datetime.datetime(hour=6,
                                              day=5,
                                              month=3,
                                              year=2012))
Esempio n. 8
0
 def test_day_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='day@10')
     self.assertEqual(begin, datetime.datetime(hour=10,
                                               day=3,
                                               month=3,
                                               year=2012))
     self.assertEqual(end, datetime.datetime(hour=10,
                                             day=4,
                                             month=3,
                                             year=2012))
Esempio n. 9
0
 def test_hour_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='hour@30')
     self.assertEqual(
         begin,
         datetime.datetime(minute=30, hour=6, day=5, month=3, year=2012))
     self.assertEqual(
         end, datetime.datetime(minute=30,
                                hour=7,
                                day=5,
                                month=3,
                                year=2012))
Esempio n. 10
0
 def test_hour(self):
     begin, end = utils.last_completed_audit_period(unit='hour')
     self.assertEqual(begin,
                      datetime.datetime(hour=7,
                                        day=5,
                                        month=3,
                                        year=2012))
     self.assertEqual(end, datetime.datetime(hour=8,
                                             day=5,
                                             month=3,
                                             year=2012))
Esempio n. 11
0
 def test_hour_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='hour@30')
     self.assertEqual(begin, datetime.datetime(minute=30,
                                               hour=6,
                                               day=5,
                                               month=3,
                                               year=2012))
     self.assertEqual(end, datetime.datetime(minute=30,
                                             hour=7,
                                             day=5,
                                             month=3,
                                             year=2012))
Esempio n. 12
0
 def test_year(self):
     begin, end = utils.last_completed_audit_period(unit='year')
     self.assertEqual(begin, datetime.datetime(day=1, month=1, year=2011))
     self.assertEqual(end, datetime.datetime(day=1, month=1, year=2012))
Esempio n. 13
0
 def test_hour(self):
     begin, end = utils.last_completed_audit_period(unit='hour')
     self.assertEqual(begin,
                      datetime.datetime(hour=7, day=5, month=3, year=2012))
     self.assertEqual(end,
                      datetime.datetime(hour=8, day=5, month=3, year=2012))
Esempio n. 14
0
 def test_day(self):
     begin, end = utils.last_completed_audit_period(unit='day')
     self.assertEqual(begin, datetime.datetime(day=4, month=3, year=2012))
     self.assertEqual(end, datetime.datetime(day=5, month=3, year=2012))
Esempio n. 15
0
 def test_year_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='year@6')
     self.assertEqual(begin, datetime.datetime(day=1, month=6, year=2010))
     self.assertEqual(end, datetime.datetime(day=1, month=6, year=2011))
Esempio n. 16
0
 def test_day_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='day@10')
     self.assertEqual(begin,
                      datetime.datetime(hour=10, day=3, month=3, year=2012))
     self.assertEqual(end,
                      datetime.datetime(hour=10, day=4, month=3, year=2012))
Esempio n. 17
0
 def test_month_with_offset_after_current(self):
     begin, end = utils.last_completed_audit_period(unit='month@15')
     self.assertEqual(begin, datetime.datetime(day=15, month=1, year=2012))
     self.assertEqual(end, datetime.datetime(day=15, month=2, year=2012))