Example #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]))
Example #2
0
 def test_dates_column_times(self):
     normal_values = xls.normalize_dates([
         xltime((14, 30, 0)),
         xltime((4, 5, 37)),
         xltime((0, 0, 0)),
         ''], 0)
     self.assertEquals(normal_values, (datetime.time, [datetime.time(14, 30, 00), datetime.time(4, 5, 37), datetime.time(0, 0, 0), None]))
Example #3
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]))
Example #4
0
 def test_dates_column_times(self):
     normal_values = xls.normalize_dates([
         xltime((14, 30, 0)),
         xltime((4, 5, 37)),
         xltime((0, 0, 0)),
         ''], 0)
     self.assertEquals(normal_values, (datetime.time, [datetime.time(14, 30, 00), datetime.time(4, 5, 37), datetime.time(0, 0, 0), None]))
Example #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
     ]))
Example #6
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]))