示例#1
0
 def test_extract_dates(self):
     text = '25 May 1977 Rome Istanbul 25 May 2005 '
     result = MatchBlock.extract_dates(text)
     self.assertEqual(result, ('Rome Istanbul', [
         datetime.datetime(1977, 5, 25, 0, 0),
         datetime.datetime(2005, 5, 25, 0, 0)
     ]))
示例#2
0
 def test_extract_dates_pass_2(self):
     original_string = '11/11/1111'
     date = datetime.datetime(1111, 11, 11, 0, 0)
     string = ''
     result = MatchBlock.extract_dates(original_string)
     self.assertEqual((string, [date]), result)
示例#3
0
 def test_extract_dates_pass_1(self):
     original_string = '11/1111'
     string = '11/1111'
     date = []
     result = MatchBlock.extract_dates(original_string)
     self.assertEqual((string, date), result)