Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))
Ejemplo 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))