def test_dates_column_datetimes(self): normal_values = xls.normalize_dates([ xldatetime((2004, 6, 5, 14, 30, 23), 0), xldatetime((1984, 2, 23, 0, 0, 0), 0), xldatetime((1907, 12, 25, 2, 0, 0), 0), ''], 0) self.assertEquals(normal_values, (datetime.datetime, [datetime.datetime(2004, 6, 5, 14, 30, 23), datetime.datetime(1984, 2, 23, 0, 0, 0), datetime.datetime(1907, 12, 25, 2, 0, 0), None]))
def tests_dates_column_dates_and_datetimes(self): normal_values = xls.normalize_dates([ xldate((2004, 6, 5), 0), xldatetime((2001, 1, 1, 4, 5, 37), 0), '' ], 0) self.assertEquals(normal_values, (datetime.datetime, [ datetime.datetime(2004, 6, 5, 0, 0, 0), datetime.datetime(2001, 1, 1, 4, 5, 37), None ]))
def test_dates_column_times_and_datetimes(self): self.assertRaises(XLSDataError, xls.normalize_dates, [ xldatetime((2004, 6, 5, 0, 30, 0), 0), xltime((4, 5, 37)), ''], 0)
def tests_dates_column_dates_and_datetimes(self): normal_values = xls.normalize_dates([ xldate((2004, 6, 5), 0), xldatetime((2001, 1, 1, 4, 5, 37), 0), ''], 0) self.assertEquals(normal_values, (datetime.datetime, [datetime.datetime(2004, 6, 5, 0, 0, 0), datetime.datetime(2001, 1, 1, 4, 5, 37), None]))
def test_dates_column_times_and_datetimes(self): self.assertRaises( XLSDataError, xls.normalize_dates, [xldatetime((2004, 6, 5, 0, 30, 0), 0), xltime((4, 5, 37)), ''], 0)