Exemple #1
0
 def test_parse_date_exception(self):
     date = 'i am no date'
     textinfo = {six.b('TextInfoItem9'): six.b(date)}
     result = parse_date(textinfo)
     self.assertIsNone(result)
Exemple #2
0
 def _parse_date(self):
     try:
         return parse_date(self.image_text_info[six.b('SLxImageTextInfo')])
     except KeyError:
         return None
Exemple #3
0
 def test_parse_date_12(self):
     date_format = "%m/%d/%Y  %I:%M:%S %p"
     date = '02/13/2016  11:43:37 PM'
     textinfo = {six.b('TextInfoItem9'): six.b(date)}
     result = parse_date(textinfo)
     self.assertEqual(result.strftime(date_format), date)