Пример #1
0
 def test_end_of_year_from_last_day(self):
     d = Pendulum(2000, 12, 31, 23, 59, 59)
     new = d.end_of('year')
     self.assertPendulum(new, 2000, 12, 31, 23, 59, 59)
Пример #2
0
 def test_end_of_month(self):
     d = Pendulum(2000, 1, 1, 2, 3, 4).end_of('month')
     new = d.end_of('month')
     self.assertPendulum(new, 2000, 1, 31, 23, 59, 59)
Пример #3
0
 def test_end_of_month_from_last_day(self):
     d = Pendulum(2000, 1, 31, 2, 3, 4)
     new = d.end_of('month')
     self.assertPendulum(new, 2000, 1, 31, 23, 59, 59)
Пример #4
0
 def test_end_of_decade_from_last_day(self):
     d = Pendulum(2009, 12, 31, 23, 59, 59)
     new = d.end_of('decade')
     self.assertPendulum(new, 2009, 12, 31, 23, 59, 59)
Пример #5
0
 def test_end_of_century_from_last_day(self):
     d = Pendulum(2100, 12, 31, 23, 59, 59)
     new = d.end_of('century')
     self.assertPendulum(new, 2100, 12, 31, 23, 59, 59)
Пример #6
0
 def test_end_of_year_from_last_day(self):
     d = Pendulum(2000, 12, 31, 23, 59, 59)
     new = d.end_of('year')
     self.assertPendulum(new, 2000, 12, 31, 23, 59, 59)
Пример #7
0
 def test_end_of_with_transition(self):
     d = Pendulum(2013, 3, 31, tzinfo='Europe/Paris')
     self.assertEqual(3600, d.offset)
     self.assertEqual(7200, d.end_of('month').offset)
     self.assertEqual(7200, d.end_of('day').offset)
     self.assertEqual(3600, d.end_of('year').offset)
Пример #8
0
 def test_end_of_month_from_last_day(self):
     d = Pendulum(2000, 1, 31, 2, 3, 4)
     new = d.end_of('month')
     self.assertPendulum(new, 2000, 1, 31, 23, 59, 59)
Пример #9
0
 def test_end_of_month(self):
     d = Pendulum(2000, 1, 1, 2, 3, 4).end_of('month')
     new = d.end_of('month')
     self.assertPendulum(new, 2000, 1, 31, 23, 59, 59)
Пример #10
0
 def test_end_of_century_from_last_day(self):
     d = Pendulum(2100, 12, 31, 23, 59, 59)
     new = d.end_of('century')
     self.assertPendulum(new, 2100, 12, 31, 23, 59, 59)
Пример #11
0
 def test_end_of_decade_from_last_day(self):
     d = Pendulum(2009, 12, 31, 23, 59, 59)
     new = d.end_of('decade')
     self.assertPendulum(new, 2009, 12, 31, 23, 59, 59)
Пример #12
0
 def test_end_of_century_from_first_day(self):
     d = Pendulum(2001, 1, 1, 1, 1, 1)
     new = d.end_of('century')
     self.assertPendulum(new, 2100, 12, 31, 23, 59, 59, 999999)