Exemplo n.º 1
0
 def _calculate_day(self):
     if 'day' in self.tokens:
         day = next_day(
             datetime.date.today(),
             self._get_isoweekday_from_str())
     else:
         day = datetime.date.today()
     return day
Exemplo n.º 2
0
 def test_next_day_next_week_where_day_has_passed(self):
     # epoch is Thursday, January 1, 1970
     next_wednesday = next_day(EPOCH_AS_DATETIME, 3)
     ok_(next_wednesday.day == 7)
     ok_(next_wednesday.year == 1970)
     ok_(next_wednesday.month == 1)
Exemplo n.º 3
0
 def test_next_day_same_week_where_day_hasnt_passed(self):
     # epoch is Thursday, January 1, 1970
     saturday = next_day(EPOCH_AS_DATETIME, 6)
     ok_(saturday.day == 3)
     ok_(saturday.year == 1970)
     ok_(saturday.month == 1)