예제 #1
0
 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]))
예제 #2
0
 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]))
예제 #3
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
     ]))
예제 #4
0
 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)
예제 #5
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]))
예제 #6
0
 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)