def testStrHeaderDateToDatetimeNone(self): """Tests StrHeaderDateToDatetime().""" self.assertEqual(None, handlers.StrHeaderDateToDatetime(''))
def testStrHeaderDateToDatetime(self): """Tests StrHeaderDateToDatetime().""" header_dt_str = 'Wed, 06 Oct 2010 03:23:34 GMT' dt = datetime.datetime(2010, 10, 06, 03, 23, 34) # same date r = handlers.StrHeaderDateToDatetime(header_dt_str) self.assertEqual(dt, r)