Beispiel #1
0
 def test_captured_pattern_next_weekday(self):
     input_text = 'Next monday'
     parser = parsing.datetime_parsing(input_text)
     self.assertIn(input_text, parser[0])
     self.assertEqual(
         parser[0][1].strftime('%d-%m-%y'),
         parsing.next_week_day(self.base_date, 0).strftime('%d-%m-%y'))
     self.assertEqual(len(parser), 1)
Beispiel #2
0
 def test_captured_pattern_next_weekday(self):
     input_text = 'Next monday'
     parser = parsing.datetime_parsing(input_text)
     self.assertIn(input_text, parser[0])
     self.assertEqual(
         parser[0][1].strftime('%d-%m-%y'),
         parsing.next_week_day(self.base_date, 0).strftime('%d-%m-%y')
     )
     self.assertEqual(len(parser), 1)
Beispiel #3
0
    def test_next_week_day(self):
        base_date = datetime(2016, 12, 7, 10, 10, 52, 85280)
        weekday = 2  # Wednesday
        result = parsing.next_week_day(base_date, weekday)

        self.assertEqual(result, datetime(2016, 12, 14, 10, 10, 52, 85280))
Beispiel #4
0
    def test_next_week_day(self):
        base_date = datetime(2016, 12, 7, 10, 10, 52, 85280)
        weekday = 2  # Wednesday
        result = parsing.next_week_day(base_date, weekday)

        self.assertEqual(result, datetime(2016, 12, 14, 10, 10, 52, 85280))